Docs menu

Flow file referenceDepends on how Ivy is set up

This page lists every field of a flow file (a file whose name ends in .ivy-flow.yaml and which starts with ivy: flow/v1). It is generated from the same schema Ivy checks the file with, so it always matches what Ivy accepts. How a flow file is tested and switched on is in Activate it.

The assistant sees a flow file’s problems in the result whenever it saves one, with the line and the section of this page that explains the field, and it can check a draft before saving it. To check the file in your own editor, use the JSON Schema Ivy serves at /schemas/flow.schema.json on your Ivy address. For editors that use the YAML language server, make this the first line of the file: # yaml-language-server: $schema=https://<your Ivy address>/schemas/flow.schema.json. In a sandbox, the schemas are in /opt/ivy/schemas/.

Files named *.ivy-workflow.yaml with the header ivy: workflow/v1 still work, and so does the schema at /schemas/workflow.schema.json.

Top-level fields

Field Type Required Default Description
description text no Up to 1,000 characters.
ivy one of flow/v1, workflow/v1 yes The format version.
name text yes 1 to 80 characters.
notify object, see notify no Failure and pause notices also go to this channel.
  • on: what starts a run, one or more of the triggers below.
  • steps: the steps, in order; each has the common step fields and the fields of its type below.
  • limits: Plan defaults apply to whatever is left out.

notify

Field Type Required Default Description
channel text yes A channel name or id in this space.

Limits

Plan defaults apply to whatever is left out.

Field Type Required Default Description
budget_credits whole number no Credits per run.
concurrency whole number no 1 Runs at once.
max_queued whole number no 10 Runs that wait at most; more are skipped.
on_busy one of queue, skip no queue What a trigger does while concurrency runs are going: queue the new run, or skip it.
timeout duration such as 10m no The whole run, waits included.

Trigger: channel

Exactly one of mention: true and match.

Field Type Required Default Description
channel text yes A channel name or id in this space.
match text no A message that matches this regular expression starts a run.
mention true or false no A message that mentions the flow starts a run.

Example:

on:
  channel:
    channel: Support
    mention: true

Trigger: email

Field Type Required Default Description
address text yes The local part of <address>.<space>@<inbound domain>.
senders list of text no Who may send: addresses (ana@example.com) or domains (example.com). Empty: the organisation’s verified domains.

Example:

on:
  email:
    address: invoices
    senders:
      - example.com

Trigger: file

Field Type Required Default Description
events list of one of created, updated yes Which changes start a run.
folder text yes A path in this space, or a folder id.
match text no A glob on the file name, such as *.pdf.
recursive true or false no Files in subfolders count too.

Example:

on:
  file:
    events:
      - created
    folder: Finance/Inbox
    match: "*.pdf"

Trigger: manual

Field Type Required Default Description
inputs map of names to object, see on.manual.inputs.<name> no The Run form, by input name.

on.manual.inputs.<name>

Field Type Required Default Description
default any value no The value when the person gives none.
options list of text no The choices of a choice input.
required true or false no A run needs a value.
type one of string, number, boolean, choice, file, date, object yes The kind of value the Run form asks for. date: YYYY-MM-DD. object: Any JSON object. The Run form has no field for it: asks and the API give it.

Example:

on:
  manual:
    inputs:
      file:
        required: true
        type: file
      note:
        type: string

Trigger: record

A change of a record of a collection of this space starts a run.

Field Type Required Default Description
collection text yes A collection of this space, by name, such as tasks.
column text no With entered and view: a column of the board, by name, in place of field and values.
field text no With entered: an indexed enum field of the collection.
fields list of text no With updated: only a change of one of these fields starts a run.
values list of text no With entered: the option keys of field whose taking starts a run.
view text no A board file of this space, by path, title or file id: only records on the board count.
when one of created, updated, entered, do yes Which change of a record starts a run. created: A record is created: by a person, an app, the assistant, a flow or a source. updated: A record’s values change. entered: A record’s field takes one of values, or it is created with one. do: A space editor chooses Do on a record.

Example:

on:
  record:
    collection: tasks
    field: status
    values:
      - doing
    when: entered

Trigger: schedule

Type:

  • cron: text
  • object, see on.schedule (frequency: hourly)
  • object, see on.schedule (frequency: daily)
  • object, see on.schedule (frequency: weekdays)
  • object, see on.schedule (frequency: weekly)
  • object, see on.schedule (frequency: monthly)

on.schedule (frequency: hourly)

Field Type Required Default Description
frequency hourly yes
minute whole number yes

on.schedule (frequency: daily)

Field Type Required Default Description
frequency daily yes
time text yes

on.schedule (frequency: weekdays)

Field Type Required Default Description
frequency weekdays yes
time text yes

on.schedule (frequency: weekly)

Field Type Required Default Description
frequency weekly yes
time text yes
weekdays list of whole number yes

on.schedule (frequency: monthly)

Field Type Required Default Description
day whole number yes
frequency monthly yes
time text yes

Example:

on:
  schedule:
    cron: 0 8 * * 1

Trigger: webhook

The URL and signing secrets live in Ivy, never in the file.

Example:

on:
  webhook: {}

Common step fields

Field Type Required Default Description
after text or list of text or map of names to text or list of text no The steps it runs after, instead of the step above it: a step id, a list of them, or step ids with the paths of each that lead here, such as {size: small, approval: approve}. start is the start of the run.
continue_on_error true or false no The run goes on when this step fails.
for_each text no Runs the step once for each item of a list, such as "{{ steps.read.output.lines }}", at most 100; the step reads its item as item, and its output is the list of the items’ outputs.
id text yes Unique in the file and kept across versions, since runs are recorded by it: a lowercase letter, then up to 31 lowercase letters, digits or _.
idempotent true or false no A started attempt is safe to repeat, so a code step interrupted mid-run is retried.
if text no A condition: the step runs only when it holds, else it is skipped. It may read trigger.*, inputs.*, state.* and earlier steps’ steps.<id>.output.
name text no What the step is called on screen, 1 to 80 characters; its id when absent.
retry object, see retry no Tries a failed step again.
set_state object no Flow state keys written when the step succeeds; values may read steps.<this id>.
timeout duration such as 10m no 10m How long one attempt may take; an ask waits for its expires instead.
when text or list of text no With one step in after: the paths of it that lead here, such as an ask’s option, a decision’s path, expired or failed.

retry

Field Type Required Default Description
attempts whole number yes 1 to 5.
backoff duration such as 10m no 30s The wait before each new attempt.

Step: code

Field Type Required Default Description
code text yes A runnable code file in this space.
connections list of text no Names declared in connections.ivy.yaml.
egress list of text no Hosts from the space egress allow-list.
environment text no The sandbox environment that runs the code file; by default the first built-in whose run rules match it.
files list of text or object, see files 2 no Files, folders (Finance/Inbox/) and globs (Finance/*.csv); a code step’s entries may be in a space this space reaches ({space, path}).
input any value no Staged as $IVY_IN/input.json for code; given to the turn for agents.
messages list of object, see messages no Recent messages of channels in this space, given to the step.
runtime text no The runtime; the code file’s own when absent.
save_to text or object, see files 2 no A folder of this space where the files the step writes are saved; a code step’s may be in a space this space reaches ({space, path}).
tier text no A sandbox size the installation offers, such as s, m or l; the smallest by default.

files 2

A file, folder or glob in a space this space reaches through connections; code steps only.

Field Type Required Default Description
path text no A file, folder (Inbox/) or glob (Pipeline/*.csv) in that space, without templates; empty for its top folder.
space text yes The space’s folder under /workspaces/ in this space’s sandboxes, such as sales.

messages

Field Type Required Default Description
channel text yes A channel name or id in this space.
since duration such as 10m no 1d How far back.

Example:

steps:
  - id: build
    code: reports/pipeline.py
    connections:
      - crm
    files:
      - Finance/*.csv
    input:
      tasks: "{{ steps.draft.output.tasks }}"
    save_to: Reports/
    timeout: 15m

Step: agent

Field Type Required Default Description
agent text yes A space agent id, ivy for the built-in assistant.
files list of text no Files, folders (Finance/Inbox/) and globs (Finance/*.csv); a code step’s entries may be in a space this space reaches ({space, path}).
input any value no Staged as $IVY_IN/input.json for code; given to the turn for agents.
messages list of object, see messages no Recent messages of channels in this space, given to the step.
model text no One of the agent’s models; its default when absent.
output object, see output no The shape of the agent’s answer, which later steps read as steps.<id>.output.
prompt text yes What the agent is asked to do. Values from templates are given to it as data, not instructions.
save_to text no A folder of this space where the files the step writes are saved; a code step’s may be in a space this space reaches ({space, path}).
tools list of text no ["files.read","files.search","files.write"] The agent’s file tools: files.read, files.search, files.write, files.write_drives.

output

Field Type Required Default Description
schema text or object yes A JSON Schema, inline or as the path of a JSON Schema file in this space.

Example:

steps:
  - id: summarise
    agent: ivy
    files:
      - Reports/pipeline.xlsx
    output:
      schema:
        properties:
          summary:
            type: string
        required:
          - summary
        type: object
    prompt: Summarise this week's pipeline changes in five bullets.

Step: ask

Field Type Required Default Description
ask object, see ask yes Asks a person and waits for the answer.

ask

Field Type Required Default Description
approve_changes text no steps.<id>: an agent step whose skipped deletes and overwrites the approver may apply.
expires duration such as 10m no 3d How long the question stays open.
in object, see ask.in no Where the question appears; required for automated runs.
items object, see ask.items no One decision per item of a list (approve, edit or reject), in one ask.
on_expiry one of fail, continue no fail What an unanswered question does to the run when it expires.
options list of text or object, see ask.options 2 no The answers to choose from.
question text yes May contain templates.
review text no steps.<id>.output.<field>: handed to the approver as an editable draft.
show object, see ask.show no What the person sees beside the question.
to person: text or role: one of workspace_admins or runner yes Who is asked. person:: A user id or the email of a space member. runner: The person who started a manual run.

ask.in

Field Type Required Default Description
channel text yes A channel name or id in this space.

ask.items

ask.items: the list an earlier step produced, decided item by item.

Field Type Required Default Description
edit list of text no The item fields the person may change before approving.
from text yes A single {{ … }} naming a list in an earlier step’s output.
label text no The item field shown as each item’s heading.
max whole number no 50 At most this many items; more fails the step.
options list of text or object, see ask.options 2 no The options an approved or edited item is decided with; without them, items are approved or rejected.
schema object no The schema of one item; taken from the source agent step’s output.schema when absent.

ask.options 2

An answer and the board choosing it adds the item to, as the person who chose it.

Field Type Required Default Description
adds_to text no A board file of this space, by title or file id, whose collection gets a record for it.
column text no With adds_to: the board’s column, by name, the record starts in; else the first column.
label text yes The answer’s text.

ask.show

Field Type Required Default Description
details any value no Shown as a table or text; may contain templates.
files list of text no Files linked beside the question.

Example:

steps:
  - id: confirm
    ask:
      expires: 1d
      in:
        channel: Standup
      items:
        edit:
          - title
          - owner
        from: "{{ steps.draft.output.tasks }}"
        label: title
        options:
          - adds_to: Team board
            label: Add to board
          - adds_to: Team board
            column: Doing
            label: Do now
      on_expiry: continue
      question: Confirm the proposed tasks.
      to:
        role: workspace_admins
    set_state:
      last_confirmed: "{{ run.started_at }}"

Step: post

Field Type Required Default Description
post object, see post yes Posts to a channel, or emails space members.

post

Field Type Required Default Description
files list of text no Files linked under the text.
text text yes Markdown.
to channel: text or email: text yes Where it goes. channel:: A channel name or id in this space. email:: workspace_admins, or a member’s user id or email.

Example:

steps:
  - id: share
    post:
      files:
        - Reports/pipeline.xlsx
      text: The weekly pipeline report is ready.
      to:
        channel: Sales

Step: action

Field Type Required Default Description
action http: object, see action.http or drive_file: object, see action.drive_file or calendar_event: object, see action.calendar_event yes A typed write outside Ivy, through a connection or an OAuth connector.

action.http

A request to a declared connection’s host through the connection gateway.

Field Type Required Default Description
body any value no Sent as JSON.
connection text yes A connection declared in connections.ivy.yaml.
host text no One of the connection’s hosts; needed only when it declares several.
method one of GET, POST, PUT, PATCH, DELETE yes
path text yes Starts with /; may contain templates.
query map of names to text no Query parameters; values may contain templates.

action.drive_file

Creates or updates a file in a connected drive outside the space’s mounts.

Field Type Required Default Description
connector one of microsoft, google yes
drive text yes The provider’s drive id.
folder text yes A folder path in the drive; may contain templates.
from text yes A run or space file whose content is written.
mode one of create, update yes Create a new file, or update the file of that name.
name text yes The file name; may contain templates.

action.calendar_event

Field Type Required Default Description
attendees list of text no Email addresses.
calendar text yes The provider’s calendar id, or primary.
connector one of microsoft, google yes
description text no
end text yes
start text yes RFC 3339 date-times.
title text yes

Example:

steps:
  - id: open_ticket
    action:
      http:
        body:
          subject: Weekly pipeline report
        connection: helpdesk
        method: POST
        path: /api/tickets

Step: record

Field Type Required Default Description
record object, see record yes Creates, updates, deletes, comments on or finds records.

record

record:: creates, updates, deletes, comments on or finds records of a collection of this space, as the run’s principal.

Field Type Required Default Description
collection text no A collection of this space, by name; the trigger’s collection when left out.
comment text no Markdown, added to the record as a comment; may contain templates.
create object, see record.create no Creates a record, or one per item of from.
delete true or from: text no true deletes the record; from deletes each record a list names.
find object, see record.find no Finds records, which are the step’s output.
id text no The record update, delete and comment change, by id; may contain templates. The trigger’s record when left out.
on_item_error one of continue, fail no With from: whether an item that fails fails the step, or is listed in its output.
sync object, see record.sync no With upsert: makes a complete input a full sync of the collection’s keyed records.
update object no Values by field key; may contain templates, and null clears a field.
upsert object, see record.upsert no Creates the record of a new key and changes the record that has it otherwise, by the collection’s key: one record, or one per item of from.

record.create

Field Type Required Default Description
collection text no A collection of this space, by name; the trigger’s collection when left out.
from text no A single {{ … }} naming a list of at most 500 items: one record per item.
values object no Values by field key; may contain templates, which read item with from.

record.find

Field Type Required Default Description
filter object no {all: [...]}: conditions on indexed fields, as a record query takes them; values may contain templates.
limit whole number no 1 to 100.
sort list of object no Up to two {field, dir}; oldest first when left out.

record.sync

Field Type Required Default Description
delete_missing true or false no Once every item succeeded, deletes the collection’s records with a key that the input didn’t name; never records without a key. Needs the collection’s access.delete.
final true or false no The chain’s last step: delete_missing keeps the records every step of the chain named, and deletes nothing when one of them didn’t succeed with every item.
id text no Chains the upsert steps of one complete input, such as its pages: each names the same id, and the last one final: true with delete_missing.

record.upsert

Field Type Required Default Description
from text no A single {{ … }} naming a list of at most 500 items: one record per item.
key text yes The value of the collection’s key field; may contain templates, which read item with from.
values object no Values by field key; may contain templates, which read item with from. A new record gets the default of fields left out; an existing one keeps them.

Example:

steps:
  - id: follow_up
    record:
      create:
        collection: tasks
        from: "{{ steps.draft.output.tasks }}"
        values:
          status: todo
          title: "{{ item.title }}"

Step: decide

Field Type Required Default Description
decide list of object, see decide yes A decision: its paths in order; the first whose if holds is taken.

decide

One path of a decide step.

Field Type Required Default Description
if text no Takes this path when it holds; the last path has none and is taken otherwise.
label text no What the path is called on screen, 1 to 80 characters; its name when absent.
path text yes The path’s name, which later steps pick with when: a lowercase letter, then lowercase letters, digits or _.

Example:

steps:
  - id: size
    name: Many tasks or few?
    after: draft
    decide:
      - if: size(steps.draft.output.tasks) > 5
        path: many
      - path: few