CLI: API Sequences
Use this section when you need to drive API sequence authoring from the
Cofactor CLI. The conceptual model lives in api-sequences; this section is
only command orientation. Prefer each command's --help output for the
current flag list.
Common flow
-
Inspect the API catalog for candidate endpoints.
bashcofactor api-catalog sources list cofactor api-catalog endpoints list --search <keyword> cofactor api-catalog endpoints get <apiRequestId>
-
Compose a sequence JSON file locally. Reference endpoints by
apiRequestIdand chain steps with{{stepId.response.path}}. -
Create an API-only workflow from the sequence file.
bashcofactor workflow create --api-only --name "smoke: create project" \ --sequence-from-file seq.json
The command returns the workflow, sequence, and node IDs.
To attach a sequence to an existing workflow that has none, run
cofactor workflow api-sequence update <workflowId> --from-file seq.json; it creates the sequence when absent and replaces the config otherwise. -
Execute immediately to surface template warnings and API failures.
bashcofactor workflow api-sequence execute <workflowId>
-
Inspect the run and iterate on the sequence file.
bashcofactor workflow runs list <workflowId> --side api cofactor workflow runs get <workflowId> <runId> cofactor workflow runs get <workflowId> <runId> --step <runStepId> --api-call <apiStepId>
Add
--jsonfor JSON; the flags print stored (capped) request/response bodies. Get<runStepId>fromruns get <workflowId> <runId> --json(steps[].id).bashcofactor workflow api-sequence update <workflowId> --from-file seq.json
Reference
- Command help:
cofactor workflow api-sequence --help - Workflow creation help:
cofactor workflow create --help - API catalog help:
cofactor api-catalog --help