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 loginorCODIKA_API_KEYenv var - API key with
workflows:triggerscope
Resolving the workflow ID
TheworkflowId is the workflowTemplateId from config.ts. If the user provides a use case folder path, read config.ts to find the available workflow IDs and their trigger types.
Supported trigger types:
- HTTP triggers (
trigger.type === 'http'): Triggered with optional payload - Schedule triggers (
trigger.type === 'schedule'): Triggered via themanualTriggerUrlconfigured inconfig.ts. The CLI creates an execution document upfront and passes it to the workflow, so--pollworks exactly like HTTP triggers. No payload is needed.
Command
Arguments
Options
Process instance ID resolution
--process-instance-idflag (highest priority)devProcessInstanceIdin--project-file(if provided)devProcessInstanceIdinproject.jsonat--pathdevProcessInstanceIdinproject.jsonin current directory
Behavior
Fire-and-forget (default)
Returns immediately with the execution ID:Poll for results (--poll)
Waits for the execution to complete, polling every 3-5 seconds:
Payload via stdin (recommended)
Use--payload-file - with a heredoc to pass JSON without shell escaping issues:
Payload from file
Save result to file
Result statuses
Examples
Error reference
Important notes
- Both HTTP and schedule triggers are supported
- Schedule triggers require a
manualTriggerUrlin config.ts (with a matching Webhook node in the workflow JSON) - The
workflowIdis theworkflowTemplateIdfrom config.ts, not the n8n workflow ID - For HTTP triggers: the request wraps your payload in
{"payload": {...}} - For schedule triggers: no payload needed (the workflow runs its own logic)
- Execution is asynchronous — the trigger returns immediately unless
--pollis used --pollworks for both trigger types- File uploads are not supported via CLI — use the platform UI