The two endpoints
Your app uses two Codika public API endpoints:
Both require authentication — an
X-API-Key header, webhook signature headers, or a query parameter.
Step 1: Trigger a workflow
payload fields must match the workflow’s input schema (defined in config.ts).
Query parameter variant
For platforms that can’t set custom headers (e.g., GCP Pub/Sub push subscriptions):Response
executionId — you’ll need it for polling.
The workflowId
This is the workflowTemplateId from the use case’s config.ts. It’s a stable identifier that doesn’t change across versions. Examples: main-workflow, http-direct-messaging, scheduled-report.
If the use case has agent skills, each skill’s workflowTemplateId field tells you the ID to use.
Step 2: Poll for results
Response
Status values
Complete trigger + poll implementation
Here’s a reusable implementation in TypeScript:Usage
Payload format
The trigger endpoint wraps your input in apayload field:
payload must match the workflow’s inputSchema field names.
The
payload wrapper is recommended but not required. If no payload key is present, the entire request body is passed through as-is. However, using the wrapper is safer and consistent with how the Codika dashboard sends data.