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-helper login or CODIKA_API_KEY env var
  • API key with workflows:trigger scope

Command

codika-helper trigger <workflowId> [options]

Arguments

ArgumentDescription
<workflowId>The workflowTemplateId from config.ts

Options

OptionDescriptionDefault
--payload <json>Inline JSON payload{}
--payload-file <path>Read payload from JSON file
--process-instance-id <id>Explicit process instance IDAuto from project.json
--path <path>Path to folder with project.jsonCurrent directory
--pollWait for execution to completeFire-and-forget
--timeout <seconds>Max poll time120
-o, --output <path>Save result to file (with —poll)stdout
--jsonJSON output

Examples

Fire-and-forget

codika-helper trigger search --payload '{"query": "test"}'
Returns immediately with execution ID.

Poll for results

codika-helper trigger search --payload '{"query": "test"}' --poll
Waits up to 120 seconds for completion.

Payload from file

codika-helper trigger analyze --payload-file ./test-input.json --poll

Save result

codika-helper trigger search --payload '{"query": "test"}' --poll -o result.json

Custom timeout

codika-helper trigger generate --poll --timeout 300

Process instance ID resolution

  1. --process-instance-id flag
  2. devProcessInstanceId in project.json at --path
  3. devProcessInstanceId in project.json in current directory

Result statuses

StatusMeaning
successWorkflow completed, resultData contains output
failedError occurred, errorDetails.message describes failure
pendingStill running (during polling)

Error reference

HTTPErrorFix
401Invalid API keyRe-login with codika-helper login
403Missing scopeCreate key with workflows:trigger scope
404Workflow not foundCheck workflowTemplateId in config.ts
412Instance inactiveRe-deploy or activate in platform

Important notes

  • Only HTTP-triggered workflows can be triggered via CLI
  • The workflowId is the workflowTemplateId, not the n8n ID
  • Payload is wrapped in {"payload": {...}} automatically
  • File uploads are not supported via CLI — use the platform UI