Skip to main content

Overview

Every workflow must have at least one trigger. The trigger type determines how the workflow starts, what data it receives, and how Codika Init registers the execution.

HTTP triggers

User-initiated execution via webhook. The user fills a form (defined by inputSchema), submits it, and waits for results.

config.ts definition

Workflow pattern

The webhook node must have responseMode set to lastNode so that Codika Submit Result returns data to the caller.
Agent access: HTTP-triggered workflows are also callable via the public API (codika trigger <workflowId>) using an API key. Create an agent skill to document the endpoint for AI agents — they’ll know exactly how to call it without touching any credentials.

n8n node configuration

Schedule triggers

Automatic execution on a cron schedule. No user input — the workflow runs at the configured time.

config.ts definition

Common cron expressions

Workflow pattern

Schedule triggers often include a manual webhook as a secondary trigger for testing:

n8n Codika Init configuration (schedule mode)

Key difference from HTTP triggers: For schedule and service event triggers, Codika Init creates the execution record by calling the platform API. For HTTP triggers, it extracts the execution metadata from the incoming webhook payload.

Service event triggers

External services (Gmail, Calendly, WhatsApp, etc.) trigger the workflow when an event occurs.

config.ts definition

Service event types

Workflow pattern

Important: Access trigger data via $('Trigger Name').first().json, not via Codika Init output. The Init node only provides execution metadata.

Webhook ID for service triggers

Some service event triggers need a webhookId on the trigger node:

Sub-workflow triggers

Sub-workflows are helper workflows called by parent workflows. They are not visible to users and cannot be triggered directly.

config.ts definition

Key rules

  • No Codika Init — sub-workflows do not register their own execution
  • At least 1 input parameter — n8n requires this
  • Cost: 0 — execution cost is attributed to the parent workflow
  • Output schema: [] — always empty (data flows back to parent via Execute Workflow node)
  • Pass execution metadata if the sub-workflow uses Codika Upload File
See Sub-Workflows guide for complete patterns.

Multiple triggers per workflow

A single workflow can have multiple triggers. Common patterns:
  • Schedule + HTTP: Automated daily run with a manual “run now” button
  • Multiple HTTP: Different entry points with different input schemas
  • HTTP + Service event: Manual run plus automatic triggering on events
Each trigger gets its own triggerId in the config.