Skip to main content

When to use

  • Start a new use case from scratch
  • Create the initial folder structure for an n8n workflow project
  • Bootstrap a new automation with correct Codika patterns

Prerequisites

  • codika CLI installed
  • For project creation: authenticated via codika login (optional — scaffolding works without auth)

Command

Arguments

Options

What it creates

Agent skills

The scaffold includes two agent skills — one for each triggerable workflow. Skills are Claude-compatible SKILL.md files that describe how to interact with the workflow’s endpoint. No skill is created for text-processor because sub-workflows are not directly triggerable. Skills are automatically collected and deployed when you run codika deploy use-case.

Template workflows

The scaffold generates three workflows that demonstrate different patterns:

main-workflow.json (HTTP trigger)

  • Webhook trigger with input validation
  • Codika Init (HTTP mode — extracts metadata)
  • Calls text-processor sub-workflow via SUBWKFL placeholder
  • Codika Submit Result / Report Error

scheduled-report.json (Schedule trigger)

  • Schedule Trigger (cron) + manual Webhook
  • Codika Init (schedule mode — creates execution via API)
  • Business logic placeholder
  • Codika Submit Result / Report Error

text-processor.json (Sub-workflow)

  • Execute Workflow Trigger (receives data from parent)
  • No Codika Init node
  • Processes data and returns result to parent

Behavior

  1. Creates the folder structure and generates all template files
  2. If authenticated and --no-project is not set:
    • Creates a project on the Codika platform via API
    • Writes projectId and organizationId to project.json
  3. If --project-id is provided:
    • Uses that ID without making an API call
    • Writes to project.json
  4. Checks if a parent directory already has codika in its package.json:
    • If found (e.g., inside a monorepo): reuses the existing workspace, skips dependency setup
    • If not found: creates package.json, tsconfig.json, .gitignore, and runs npm install
  5. If --no-install is set: creates the dependency files but skips npm install

Project organization

Single use case (default)

When you scaffold a use case in a standalone directory, the CLI creates a self-contained project with its own package.json and dependencies:
This is the simplest approach — each use case is a self-contained, portable project.

Multiple use cases (shared workspace)

If you plan to manage multiple use cases in a single repository, create a shared workspace with one package.json at the root. All use cases share the same dependencies:
The CLI automatically detects the shared package.json and skips creating per-use-case dependency files. Each use case is still independently deployable — codika deploy use-case ./email-automation works regardless of the project structure. This is the recommended approach when you have multiple use cases, since it avoids duplicating node_modules and keeps everything in one place.

Examples

Next steps after init

If you used --no-project, create a project before deploying:

Exit codes