Skip to main content

Mandatory workflow pattern

Every parent workflow (not sub-workflows) must follow this structure:
Without these nodes:
  • Missing Codika Init: Platform cannot track execution, credentials unavailable
  • Missing Submit/Report: Execution shows as “pending” forever, user sees no feedback
Sub-workflows start with Execute Workflow Trigger and do not include Codika Init, Submit Result, or Report Error nodes.

Codika nodes

These are custom n8n nodes that integrate workflows with the Codika platform. They use the node type n8n-nodes-codika.codika in workflow JSON.

Codika Init (initWorkflow)

First node after the trigger in all parent workflows. Two modes depending on trigger type: HTTP triggers — extracts execution metadata from the webhook payload:
Schedule and service event triggers — creates the execution by calling the platform API:
Outputs: executionId, executionSecret, callbackUrl, processId, userId, workflowId

Codika Submit Result (submitResult)

End of success paths. Sends structured result data back to the platform.
The resultData must be a JSON string matching the workflow’s outputSchema.

Codika Report Error (reportError)

End of error/failure paths. Reports the error to the platform.
Error types: node_failure, validation_error, external_api_error, timeout

Codika Upload File (uploadFile)

Uploads files generated by the workflow (PDFs, images, videos) to platform storage.
Returns a documentId that can be included in the output schema as a file type field. In sub-workflows, you must pass execution metadata explicitly:

Workflow JSON structure

A valid n8n workflow JSON file contains:

Required settings

Fields to remove before committing

These are n8n internal fields that must be stripped from workflow JSON:
  • id (top-level workflow ID)
  • versionId
  • meta
  • active
  • tags
  • pinData
The codika verify command checks for these via the workflow-sanitization rule and can auto-fix with --fix.

Common n8n node types

Critical rules

  1. Never use Merge node before Codika terminal nodes — causes deadlock on conditional branches
  2. All execution paths must end with Submit Result or Report Error — no dead ends
  3. HTTP trigger responseMode must be lastNode — ensures Codika Submit Result returns data properly
  4. Error handling in IF nodes — every IF must have both True and False branches handled
  5. Access trigger data correctly — use $('Trigger Name').first().json, not via Codika Init output