Skip to content

Actions

Actions are the verbs of a pipeline. If a pipeline is a recipe and steps are the cooking instructions, actions are the techniques: "chop", "sauté", "blend". They're what actually gets done.

Every step has an action field that says what to do:

yaml
- name: summarize
  action: ai         # the action
  prompt: "Summarize: {{ input.text }}"

The action type determines what fields the step accepts and what outputs it produces.

Available actions

JigSpec ships with a small set of core actions. Here's the full catalog:

ai Implemented — Send prompts, run agents, extract structured data, classify input. The workhorse action. See AI Action.

code Implemented — Inline JavaScript (Node.js subprocess) — the escape hatch for arbitrary logic. See Code Action.

loop Implemented — Repeat a step for each item in a list (for-each) or until a condition holds (dynamic-exit). See Control Flow — Loops.

route Implemented — Pick one branch from a list of options, decided by an AI prompt or inline code. See Control Flow — Conditional routing.

human/approve Implemented — Pause the pipeline and wait for a human to approve or reject before continuing. Works in CLI mode (stdin prompt) or via the viewer/editor's approval panel.

human/input Implemented — Pause for freeform text or a multi-choice selection from a human, then make that value available to downstream steps.

pipeline/run Implemented — Run another pipeline (local file or github:owner/repo@ref) as a step. See Pipeline composition.

The ai action covers most pipeline needs. It's a single action with four modes of operation — the mode is determined by which fields you set.

Extensibility

Actions are designed to be extensible. The action registry is open — future versions of JigSpec may add actions for HTTP requests and other operations, and implementations can register custom actions under their own namespace.

Start with ai

For most pipelines, ai is all you need. The four modes — prompt, agent, extract, classify — cover the vast majority of AI workflow patterns. Only reach for code when you need arbitrary logic.