Browse docsMenu

Concept

Function

Deterministic code for steps that shouldn’t be AI judgment: validation, math, formatting.

What a function is

Not everything should be left to a model. Functions are plain code the pod runs exactly the same way every time — perfect for scoring, validating, transforming, and calling APIs. Use agents for judgment, functions for rules. Flows mix both freely.

Reach for it when

  • The step has exact rules: scoring, validation, math, formatting.
  • The same input must always produce the same output.
  • An API call needs retries and typed inputs, not improvisation.
  • An agent keeps being asked to do arithmetic or apply a rulebook.

Write the deterministic step

  1. 1
    Open Functions (via Workflows) and create one with a typed input schema.
  2. 2
    Keep it single-purpose: score-lead, validate-expense, format-reply.
  3. 3
    Run it standalone with realistic input and check the output shape.
  4. 4
    Use it as a workflow step or call it from an agent that needs the rulebook applied.

Where it lives

Functions, reachable from the Workflows section.