When to use
- Test a deployed workflow
- Execute a workflow via the CLI instead of the platform UI
- Automate workflow execution in scripts or CI
Prerequisites
- Use case deployed (
project.jsoncontainsdevProcessInstanceId) - Authenticated via
codika-helper loginorCODIKA_API_KEYenv var - API key with
workflows:triggerscope
Command
Arguments
| Argument | Description |
|---|---|
<workflowId> | The workflowTemplateId from config.ts |
Options
| Option | Description | Default |
|---|---|---|
--payload <json> | Inline JSON payload | {} |
--payload-file <path> | Read payload from JSON file | — |
--process-instance-id <id> | Explicit process instance ID | Auto from project.json |
--path <path> | Path to folder with project.json | Current directory |
--poll | Wait for execution to complete | Fire-and-forget |
--timeout <seconds> | Max poll time | 120 |
-o, --output <path> | Save result to file (with —poll) | stdout |
--json | JSON output | — |
Examples
Fire-and-forget
Poll for results
Payload from file
Save result
Custom timeout
Process instance ID resolution
--process-instance-idflagdevProcessInstanceIdin project.json at--pathdevProcessInstanceIdin project.json in current directory
Result statuses
| Status | Meaning |
|---|---|
success | Workflow completed, resultData contains output |
failed | Error occurred, errorDetails.message describes failure |
pending | Still running (during polling) |
Error reference
| HTTP | Error | Fix |
|---|---|---|
| 401 | Invalid API key | Re-login with codika-helper login |
| 403 | Missing scope | Create key with workflows:trigger scope |
| 404 | Workflow not found | Check workflowTemplateId in config.ts |
| 412 | Instance inactive | Re-deploy or activate in platform |
Important notes
- Only HTTP-triggered workflows can be triggered via CLI
- The
workflowIdis theworkflowTemplateId, not the n8n ID - Payload is wrapped in
{"payload": {...}}automatically - File uploads are not supported via CLI — use the platform UI