Skip to main content

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.json contains devProcessInstanceId)
  • Authenticated via codika login or CODIKA_API_KEY env var
  • API key with workflows:trigger scope

Resolving the workflow ID

The workflowId 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 the manualTriggerUrl configured in config.ts. The CLI creates an execution document upfront and passes it to the workflow, so --poll works exactly like HTTP triggers. No payload is needed.

Command

Arguments

Options

Process instance ID resolution

  1. --process-instance-id flag (highest priority)
  2. devProcessInstanceId in --project-file (if provided)
  3. devProcessInstanceId in project.json at --path
  4. devProcessInstanceId in project.json in 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:
Use --payload-file - with a heredoc to pass JSON without shell escaping issues:
This is the recommended approach when calling from scripts or AI agents, as it avoids shell quoting problems with nested JSON.

Payload from file

The file must contain a JSON object.

Save result to file

Result statuses

Examples

Error reference

Important notes

  • Both HTTP and schedule triggers are supported
  • Schedule triggers require a manualTriggerUrl in config.ts (with a matching Webhook node in the workflow JSON)
  • The workflowId is the workflowTemplateId from 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 --poll is used
  • --poll works for both trigger types
  • File uploads are not supported via CLI — use the platform UI