The workflow tool

DataMind Oda can run a written plan that spreads many small tasks across helper agents: a workflow. The tool behind it takes a JavaScript script, runs it, and returns the script's final value to the chat. Oda uses it only when you explicitly ask for a workflow or for large multi-agent orchestration.

What the workflow tool does

The call's fields

FieldWhat it carries
scriptThe script body: plain JavaScript, not TypeScript. Top-level await is allowed, and the body ends with return of the value to hand back.
metaThe run's identity: its name and description, plus optional whenToUse and phases (described below).
argsOptional input for the script, as plain JSON data; the script reads it as args.
run_in_backgroundOptional. Starts the run as a background job and answers with a job id at once, instead of holding the turn until the script finishes.

The script and its hooks

The script coordinates; the helpers do the work. The tool hands the script a small set of hooks and nothing else: no filesystem, network, timer or Node.js APIs are provided.

js
const summaries = await parallel([
  () => agent('Summarise report A'),
  () => agent('Summarise report B'),
]);
return { summaries };

The meta block

Follow and stop a run

How a run ends

A run settles once: it completes, is cancelled, or fails.

The environment a script runs in

Behind the tool

Questions, answered

How do I start a workflow?

Ask Oda in your own words for a workflow, or for large multi-agent orchestration such as an audit over many files, a migration or multi-angle research. Oda writes the script and calls the tool, and the call appears as a card titled workflow: <name>. For one or two delegations Oda uses plain helper calls instead; see Delegating work to subagents.

What is a workflow script written in?

Plain JavaScript, not TypeScript. It can wait at the top level and ends with return; it coordinates with the hooks (agent(), parallel(), pipeline(), phase(), log()) while the helpers do the work. The tool provides no filesystem, network, timer or Node.js APIs of its own.

Which fields does the meta block accept?

name (short kebab-case) and description are required, and whenToUse and phases are optional. A field outside the set is refused and named. The block is data: it travels in the call's meta field, never in the script.

Which options does an agent() call take?

label (the name shown for the call in progress lines), phase, schema (for a structured result, within a supported subset of schemas), and provider and model overrides. Anything outside the set is refused, and the message names the supported options.

What happens while a workflow runs in the background?

The call is accepted at once with a job id, and the run registers as a job of the chat. The job streams the run's phases and one line for each helper start or end; before the run settles, a read reports its status only, and the return value arrives when it settles. See Background runs and jobs.

How do I stop a running workflow?

Stop the run's job from the chat, or ask Oda to stop it; a foreground run stops with the turn's Stop (Stopping Oda and queued messages). A stopped run ends as cancelled, and nothing it produced is reported as success.

What does a finished run return?

workflow "<name>" completed (<n> agents). followed by Return value: and the script's value. The count is how many helper calls the run started. If the text runs longer than its cap (50,000 characters by default), it is truncated and the notice says how much was omitted.

Why does the workflow tool not offer run_in_background?

Background runs can be switched off for the tool. The field is then not offered on calls, and a call that still asks for one is refused with run_in_background is disabled for this tool. A background run also needs the app's jobs surface; without it, the call is refused, saying background jobs are unavailable.

Can a workflow change my files or read my credentials?

The script's environment is empty: no credentials, no proxy settings and no other machine environment reach it. File changes follow the calling chat's policy: Read Only stops them, Workspace Write keeps them inside the workspace, and Full access applies no file limits (Permission presets). Network access is not restricted by that policy.