FlowsDepends on how Ivy is set up
A flow runs code or an agent for a space without anyone starting it by hand: on a schedule, when a request arrives from another system, or when a file changes. This page explains how to create one, try it safely, activate it and follow its runs. Flows used to be called automations or workflows.
Flows depend on the installation: they are only there when your Ivy operator has turned them on. They live in a space, in its Flows section. Every member who can see the space’s files can read its flows; creating, testing, activating and running them needs the editor or admin role in the space, and some flows need a space admin.
What a flow is
A flow is a file in the space whose name ends in .ivy-flow.yaml. It states what starts the flow (its triggers), the steps that run in order, and what they may reach outside their own run. Files named *.ivy-workflow.yaml that start with ivy: workflow/v1 still work as flows.
A file does nothing until a person activates one of its versions. Runs always use the active version, never a newer one that nobody has activated.
Create a flow
Start with a schedule or a webhook
- In the space’s Flows section, choose New flow, then On a schedule or From a webhook.
- Enter a name and choose what to run under What to run: a code file of the space, or an agent with a prompt.
- For a schedule, set the time under When, with the simple choices or a cron expression. Times are in the space’s time zone, and runs must be at least 5 minutes apart.
- Optionally choose a channel under Post the result to, where the installation has channels.
- Choose Create schedule or Create webhook.
Ivy writes a small flow into the space’s Flows folder and activates it. Open it later to change it.
Only a space admin can create a webhook, and Ivy asks them to confirm their identity first. The webhook’s address and its first signing secret are shown once, when it is created. Where plans apply, webhooks need the Business or Enterprise plan.
Write the flow file
For more than one step, write the file yourself or ask the assistant to. Save it anywhere in the space with a name that ends in .ivy-flow.yaml:
ivy: flow/v1
name: Weekly pipeline summary
on:
schedule: { cron: "0 8 * * 1" }
steps:
- id: build
code: reports/pipeline.py
files: ["Sales/*.csv"]
- id: summarise
agent: ivy
prompt: Summarise this week’s changes to the sales pipeline in five bullets.
- id: share
post:
to: { channel: Sales }
text: "{{ steps.summarise.output.text }}"
Each kind of step takes its own fields: a code step names the file to run (code: <path>) and what it may read (files), an agent step its prompt. The flow file reference lists every trigger, step and field with an example of each.
Opening the file draws the flow’s steps as cards and its runs on them. Above them, About this flow gives the description written in the file, and What it can reach lists what the steps reach outside the space, such as the channels they post to, the people they email and the connections and hosts they use, each with the steps that do it. Each trigger is a pill above the first card: choose it to see its settings, its status, its next run, when it last started a run and its address. Each card names its step in plain words, with badges for its condition, retries, timeout, what it reaches outside the space and what it remembers for later runs. In the details of a code step, Summarise this code writes a short summary of the code, marked AI-written. Run history, above the cards, lists every run and draws the one you choose on them (Follow its status and runs). A problem Ivy found shows on its card with Show in code.
To see or edit the file itself, open it with Code from Open with…: the problems Ivy found are listed above the code, each with its line, and choosing one takes you to that line, which is marked in the editor.
A file inside a connected drive can be read here but not activated.
Start from a conversation, a code run or a template
Where the installation has authoring turned on, Ivy drafts the file for you: Make this a flow in the menu of a conversation or on a successful code run, and From a template under New flow in the Flows section for templates from the space’s packages. Check the draft, then choose Save as inactive. It stays inactive when you save it. Nothing runs until you check it and activate it.
Choose what starts it
A file declares one or more triggers under on:.
| Trigger | Starts a run |
|---|---|
| Manual | When a person chooses Run or an API key starts it, with inputs if the file asks for them. |
| Schedule | At the times of a cron expression, in the space’s time zone. |
| Webhook | When its address receives a request signed with one of its secrets. |
| File | When a file is added to a folder or changes in it, once it has passed the malware scan. |
A space admin manages a webhook’s signing secrets in its trigger’s panel: choose the webhook’s pill above the first card, then New secret. Create a new secret before you revoke the old one; each is shown only once.
A manual trigger can also take an object input, which takes any JSON object, for runs started through the API with structured data. It has no field in the Run form, so a flow with a required object input isn’t started with Run.
Channel messages and incoming email
Where the installation has the extended triggers turned on, a flow can also start on Channel message in a channel of the space, and on Email, which gives the space an address of its own and needs incoming email to be set up on the installation.
Records of a collection
Where the installation has collections turned on, a record trigger starts a run when a record of one of the space’s collections changes, such as a card on a board. collection names the collection, and when the change:
created: a record is created, by a person, an app, the assistant, another flow or a source.updated: a record’s values change. Withfields, only a change to one of those fields counts.entered: a record’sfield, an indexed option field, takes one ofvalues, its option keys, also when the record is created with one.do: a space editor chooses Do on the record.
view names a board file by its path, title or file id, and then only records on that board count; with do, only Do on that board. With entered and a view, column names a column of the board in place of field and values. This flow picks up each task moved to Doing, has the assistant do it, and marks it done:
ivy: flow/v1
name: Do a task
on:
record:
collection: tasks
when: entered
view: Team board
column: Doing
steps:
- id: work
agent: ivy
prompt: "Do this task: {{ trigger.record.fields.title }}. {{ trigger.record.fields.detail }}"
- id: done
record:
update: { status: done }
comment: "Done: {{ steps.work.output.text }}"
The steps read the record as trigger.record (its id, fields, url, created_at and updated_at), its collection as trigger.collection (id and name), the names of the fields that changed as trigger.changed, trigger.view and trigger.column when the trigger names them, who made the change as trigger.by (its type and id), and trigger.attempt.
Runs act as the space identity. A trigger runs once per record and attempt: Run again on a run fires the same trigger for the same record again. An updated trigger runs once per change. A flow’s own writes never start its own record triggers, and a trigger that starts more than 60 runs in an hour pauses the flow. The check warns about an updated trigger without fields on a collection the flow’s own steps write: list in fields only the changes that should start a run.
Add steps
Steps run in order. Each has an id and exactly one kind:
| Step | What it does |
|---|---|
| Code | Runs a code file of the space in a sandbox, without network access unless the step declares hosts. |
| Agent | Gives an agent a prompt. The agent reaches only the files and folders the step names; ivy is the built-in assistant. |
| Question | Asks a person to approve, edit or answer, and waits for them; see approval steps. |
| Post | Posts text and file links to a channel of the space, or emails space members. |
A step can carry a condition (if), a timeout and retries; a step whose condition isn’t met is skipped. Results reach people only through question and post steps, and never people outside the space.
A code step runs in the file’s default environment at the smallest compute size unless it names others: environment: takes the name of a built-in environment or one of your organisation’s, and tier: a size offered on your installation.
- id: map
code: analysis/parcels.py
environment: acme-gis
tier: m
In the visual view, the step editor sets both with its Environment and Compute size fields.
Use files in other spaces
A code step can also read files in a space that this space reaches through its space connections, and save into one. Name that space by its folder under /workspaces/, the name the assistant and the sandbox show for it:
- id: report
code: reports/weekly.py
files:
- Finance/Inbox/
- space: sales
path: Pipeline/*.csv
save_to:
space: finance-reports
path: Weekly/
pathis a file, folder or glob in that space, written out without templates. Leave it out for the space’s top folder.- Reading needs a connection that lets this space read the other one, and saving one that lets it write. With write access alone (a drop box), the step saves only into the top folder or into folders this space created there. Ivy reports a space that this space doesn’t reach, or reaches with too little access, as
space_not_reached. - The code finds the files read-only under
$IVY_IN/workspaces/<space>/, with their paths relative to the entry that names them: the entry above stagesPipeline/leads.csvas$IVY_IN/workspaces/sales/leads.csv. Only the paths the step names are there. - The step reaches the other space only through this space’s connections, never through the memberships of the person or identity the run acts as. Activation fails while the space identity isn’t allowed to save there.
- Files it saves there are new versions in that space, attributed to whoever the run acts as. They start that space’s flows, count towards its storage and are recorded in both spaces’ logs. A test run reads the other space’s files but saves nothing there.
- What it can reach lists each other space with the access the flow needs there. Activating a version that saves into another space needs a space admin; reading doesn’t.
- If a connection has been removed or lowered since the version was activated, the step fails with
reach_changedbefore its code runs, and the flow is paused until a version is activated again. A save that is refused after the code ran fails the step withoutput_not_saved.
Agent steps keep to their own space’s files; in a conversation, the assistant already reaches the spaces this space is connected to.
Actions in other services
Where the extended features are on, a step of the kind Action sends an HTTP request through a connection or writes a file to a connected drive.
Create and change records
Where the installation has collections turned on, a record step does one thing with the records of a collection of the space:
| Field | What it does |
|---|---|
create |
Creates a record from values. With from, a single {{ … }} naming a list of up to 500 items, it creates one record per item, and values reads each item as item; the output lists each item’s record_id or error. |
update |
Sets the fields it lists, by key; null clears a field. |
upsert |
Creates the record whose key value is new, else changes the fields values gives, by the collection’s key; see import data from another system. |
delete |
true deletes the record; delete: { from: … } deletes each record a list names, by id or as objects with an id. |
comment |
Adds a comment in Markdown, alone or with update. |
find |
Finds up to 100 records with filter, sort and limit; the output has records and more. |
The step works in the trigger’s collection, and update, delete and comment on the trigger’s record, unless it names collection and id, which may contain templates. A step without id needs a record trigger. With from, on_item_error: continue lists an item that fails in the output instead of failing the step.
- id: follow_up
record:
create:
collection: tasks
from: "{{ steps.propose.output.tasks }}"
values: { title: "{{ item.title }}", status: todo }
- id: doing
record:
collection: tasks
find:
filter: { all: [{ field: status, op: eq, value: doing }] }
limit: 20
The step acts as the run’s principal, so a run started by an event writes as the space identity, which may also write collections and fields declared access: flows. It fails with record_missing, collection_missing or a validation code such as field_missing. A test run writes nothing: the run shows what the step would have written.
Import data from another system
A flow can keep a collection in step with another system, such as the company’s CRM or database: a code step reads the data through a connection, and a record step upserts it into a collection that declares a key. upsert takes the key value in key and the fields in values; with from, a list of up to 500 items, both read each item as item. The step creates the record of a new key value and changes the record that has it otherwise, so running the flow again updates records instead of duplicating them. An item that changes nothing writes nothing.
- id: save
record:
collection: customers
upsert:
from: "{{ steps.read.output.customers }}"
key: "{{ item.id }}"
values: { name: "{{ item.name }}", segment: "{{ item.segment }}" }
sync: { delete_missing: true }
sync: { delete_missing: true } makes a complete list a full copy: once every item succeeded, the step deletes the collection’s records whose key the list didn’t name. An empty list deletes nothing, since a source that failed quietly looks the same. It never deletes records without a key value, and it needs the collection’s access.delete. When the data comes in pages, one upsert step each, give every step the same sync: { id: customers } and the last one sync: { id: customers, final: true, delete_missing: true }. The last step deletes the records that no step of the chain named, and deletes nothing, with sync_incomplete: true in its output, when a step of the chain didn’t succeed with every item or named no record.
The output lists each item in items with its index, its outcome (created, updated, unchanged, deleted, failed or skipped), its record_id and key, and the error of an item that failed; then the counts created, updated, unchanged, deleted and failed, and deleted_missing after a sync. A large list is paced at the collection’s write rate, not refused. A flow’s own writes never start its own record triggers, and an upsert that changes nothing starts no flow. What it can reach lists a step with delete_missing as deleting from its collection, and the check reports collection_has_no_key when the collection declares no key. The template Import customers, under From a template, starts you off.
Add an approval step to keep a human in the loop
An ask step brings a person into the flow: the run stops at it until they approve, reject, edit or answer, and later steps use what they decided. Use one for a sign-off before something is posted, a review of a draft, or a decision on each item of a list.
Approve or reject before a post
options are the choices the person picks from, show puts the evidence beside the question, and the next step’s condition (if) reads the decision:
ivy: flow/v1
name: Weekly summary with sign-off
on:
schedule: { cron: "0 8 * * 1" }
steps:
- id: summarise
agent: ivy
prompt: Summarise this week’s changes to the sales pipeline in five bullets.
files: ["Sales/*.csv"]
- id: approve
ask:
to: { role: workspace_admins }
in: { channel: Sales }
question: Post this summary to the Sales channel?
show:
details: "{{ steps.summarise.output.text }}"
options: [Approve, Reject]
expires: 1d
on_expiry: continue
- id: share
if: steps.approve.output.decision == 'Approve'
post:
to: { channel: Sales }
text: "{{ steps.summarise.output.text }}"
Have a person review a draft or each item
An ask can also hand the person what an earlier step produced, to change before they approve it.
Edit a draft, then approve it
With review, the person gets an earlier step’s output as a draft they can edit before they choose Approve. Later steps read the approved text as steps.<ask id>.output.value, so what was approved is what is sent:
ivy: flow/v1
name: Reply to a supplier
on:
manual:
inputs:
request: { type: string, required: true }
steps:
- id: draft
agent: ivy
prompt: "Draft a short, polite reply to this supplier request: {{ inputs.request }}"
- id: check
ask:
to: runner
question: Check the reply before it goes to the Purchasing channel.
review: steps.draft.output.text
- id: send
post:
to: { channel: Purchasing }
text: "{{ steps.check.output.value }}"
Approve, edit or reject each item
With items, one question lists every item an earlier step proposed. The person chooses Approve, Edit or Reject for each, changes only the fields under edit, and chooses Send decisions once. The list needs a known shape: here the agent step’s output.schema. Later steps get the approved and edited items as steps.<ask id>.output.items, and the rejected ones as output.rejected; each entry holds its item in value:
ivy: flow/v1
name: Tasks from meeting notes
on:
manual:
steps:
- id: propose
agent: ivy
prompt: Propose one task per action item in this week’s meeting notes.
files: ["Meetings/*.md"]
output:
schema:
type: object
required: [tasks]
properties:
tasks:
type: array
items:
type: object
required: [title]
properties: { title: { type: string }, owner: { type: string } }
- id: confirm
ask:
to: runner
question: Which of these tasks should we create?
items:
from: "{{ steps.propose.output.tasks }}"
label: title
edit: [title, owner]
- id: create
code: tasks/create_tasks.py
input: { tasks: "{{ steps.confirm.output.items }}" }
A list of more than 50 items fails the step, and an empty list asks nobody.
Add records to a board from an ask
Where the installation has collections turned on, an option of a question can add the item to a board (adds_to:, the board’s title or its file id) and to a column of it (column:, a column’s name). Choosing the option creates a record in the board’s collection:
- id: confirm
ask:
to: { role: workspace_admins }
in: { channel: Standup }
question: Confirm the tasks from today’s standup.
items:
from: "{{ steps.propose.output.tasks }}"
label: title
edit: [title, detail, due]
options:
- { label: Add to board, adds_to: Team board }
- { label: Do now, adds_to: Team board, column: Doing }
- A question about one thing: each entry of
optionsis a text or{label, adds_to, column}. The record is made from the question’sreviewvalue, or else itsshow.details, which then needs atitle. - A list of items:
items.optionslists the options each item is decided with, besides rejecting it. Withoutitems.options, items are approved or rejected as before. adds_tocreates one record per item, at most once, even when the question is answered in Slack and in Ivy, as the person who answered. The item’s fields go into the collection’s fields of the same name, and itslabel(ortitle) becomes the record’s title: fortasks, an item’sdetail,dueandlabelsfill the task’s.columnputs the record in that column, with the column’s first value; without it, the record goes into the board’s first column. Either way it lands at the bottom of the column unless the board saysnew: top.
The board named in adds_to and the column named in column must exist in the space; the check marks the file otherwise. What it can reach lists each board the file adds to.
Who approves, and how to approve in Slack or Teams
to names who decides: { person: <email or user id> } for a member of the space, { role: workspace_admins } for any one of its admins, or runner for the person who started a manual run. Only that person, or one of those admins, can decide.
- A run someone starts by hand can ask without
in. A question to the runner appears on the run, drawn on the flow’s steps. A question to anyone else waits for the runner to choose Send question before it goes to that person in a new private conversation. - A run started by a schedule, a webhook, a file or another event asks in a channel of the space, named with
in: { channel: … }, andrunnercan’t be used. The check refuses the file otherwise. In a channel that isn’t open to every member of the space, the space identity must be one of its members, or activation fails, and everyone it asks must be a member too, or the step fails. - In Slack or Teams: in a channel mirrored to Slack or Teams, the question also appears there, with a button for each option. Only someone who may answer can use them. A free-text answer, a draft to edit or a list of items is answered in Ivy, through the message’s link. A channel with readers outside the space shows only a link to the question.
While a run waits, its status is Waiting for a person, and the flow shows whom it waits for and since when (When a run waits for a person).
When nobody answers
A question is open for 3 days unless expires says otherwise, and never longer than the run’s limits.timeout. If nobody answers in that time, the run fails, or with on_expiry: continue it goes on with the decision expired. In the first example, an unanswered sign-off skips the post.
Test a flow that asks
In a test run, every question comes to you, whoever it names. You decide on the run drawn on the steps, nothing reaches the channel, Slack or Teams, and later steps run with your decision, so you can try both approving and rejecting. When you activate, What it can reach lists whom the flow asks, where, and what it shows them.
Paths and steps at the same time
Where the installation has paths turned on, a flow can do more than one step after another: steps can run at the same time, a decision or an answer can send the run down one path or another, and a step can say what happens when another one fails. A flow that uses none of this runs as before, each step after the one above it.
This flow approves supplier invoices. When a PDF arrives in Finance/Inbox, Ivy reads it, then checks the supplier and the budget at the same time. Large invoices go to Accounts for approval, small ones straight to payment. Once the payment is scheduled, the team is told; if it can’t be scheduled, Accounts is asked to pay by hand; if Accounts rejects the invoice, they are told so. Every path ends with filing the invoice. These are its steps:
steps:
- id: read
name: Read the invoice
agent: ivy
prompt: Read the supplier, invoice number, total and due date from this invoice.
files: ["{{ trigger.file }}"]
- id: check_supplier
name: Check the supplier
after: read
code: finance/check_supplier.py
input: "{{ steps.read.output }}"
- id: check_budget
name: Check the budget
after: read
code: finance/check_budget.py
input: "{{ steps.read.output }}"
- id: size
name: Large or small?
after: [check_supplier, check_budget]
decide:
- path: large
if: steps.read.output.total > 1000 || steps.check_budget.output.over_budget
- path: small
- id: approval
name: Ask Accounts to approve
after: size
when: large
ask:
to: { role: workspace_admins }
in: { channel: Accounts payable }
question: "Approve {{ steps.read.output.supplier }}, {{ steps.read.output.total }} EUR?"
show: { details: "{{ steps.check_supplier.output }}", files: ["{{ trigger.file }}"] }
options: [approve, reject]
expires: 3d
- id: pay
name: Schedule the payment
after: { size: small, approval: approve }
code: finance/schedule_payment.py
input: "{{ steps.read.output }}"
connections: [bank]
- id: tell_team
name: Tell the team
post:
to: { channel: Accounts payable }
text: "{{ steps.read.output.supplier }} {{ steps.read.output.invoice_number }} is scheduled for payment."
- id: payment_problem
name: Tell Accounts to pay by hand
after: pay
when: failed
post:
to: { channel: Accounts payable }
text: "Couldn't schedule {{ steps.read.output.invoice_number }}. Please pay it by hand."
- id: reply_rejected
name: Tell Accounts it was rejected
after: approval
when: reject
post:
to: { email: workspace_admins }
text: "Invoice {{ steps.read.output.invoice_number }} was rejected; reply to the supplier."
- id: file_it
name: File the invoice
after: [tell_team, payment_problem, reply_rejected]
code: finance/archive.py
input: { file: "{{ trigger.file }}" }
Run a step after others
after (Runs after in the editor) names the steps a step waits for, instead of the step above it:
after: read: the step starts oncereadhas finished. Steps after the same step, herecheck_supplierandcheck_budget, run at the same time.after: [check_supplier, check_budget]: the step waits until both have ended.- A step where paths meet again runs once, whichever path led to it:
file_itfiles the invoice once, after the payment, the problem with it or the rejection. after: start: the step runs as soon as the run starts.- A step without
afterruns after the step written above it, astell_teamruns afterpay.
name (Name) is what a step is called on screen, such as “Read the invoice”, in up to 80 characters; without it, the step is shown by its id. A step can use the results only of the steps it runs after, directly or through others.
Choose a path
A decision (decide) sends the run down one of its paths. It lists them in order, each with its name (path) and a condition (if); the run takes the first path whose condition holds. The last path has no condition and is taken otherwise. A decision does nothing else. A path may also have a label, up to 80 characters, which the steps view shows instead of its name, such as label: "Large amount".
when (Path) says which outcome of the step in after leads to this step:
- an option of a question, such as
when: reject; - a path of a decision, such as
when: large; expired: nobody answered the question in time, withon_expiry: continue;failed, if this fails: the step failed. The run carries on along this path instead of failing, aspayment_problemdoes when the payment can’t be scheduled.
when can list several outcomes, such as when: [reject, expired]. A step reached from two decisions names the path of each in after: pay runs after the path small of size or the path approve of approval, written after: { size: small, approval: approve }.
When a step is skipped or fails
- A step whose condition (
if, Only if) doesn’t hold is skipped, and the path carries on past it: steps that simply run after it still run, steps that wait for one of its paths (when) don’t. A run shows such a step as Skipped: only runs if …, with its condition. - A step on a path the run didn’t take shows as Not on the path taken, so you can tell it apart from a skipped one.
- With
continue_on_error, a step that fails counts as done, and its path carries on. - A step that fails without an if this fails path fails the run: the steps still at work on other paths are stopped, questions still open are withdrawn, and nothing new starts.
How much runs at once
At most 4 steps of one run are at work at the same time; the others wait their turn. A question waiting for an answer doesn’t count.
limits.on_busy says what a new run does while limits.concurrency runs of the flow are already going: wait its turn (queue) or be skipped (skip).
Run a step for each item
for_each (For each) runs a step once for each item of a list, such as the lines an agent read from an order. The step reads its item as item:
steps:
- id: read
agent: ivy
prompt: List the lines of this order, each with its product and quantity.
files: ["{{ trigger.file }}"]
- id: check_stock
for_each: "{{ steps.read.output.lines }}"
code: orders/check_stock.py
input: "{{ item }}"
- The list has at most 100 items; a longer one fails the step. With an empty list the step does nothing.
- Its items count towards the 4 steps of a run at work at the same time.
- The step’s output is the list of its items’ outputs, in the order of the list.
- If an item fails, the step fails, and with it the run unless the step has an if this fails path. With
continue_on_error, the step carries on, and a failed or skipped item’s output is empty (null). - A step with
for_eachcan’t write flow state (set_state): its items would overwrite each other.
Check and test before you activate
Ivy checks the version on screen when you open it: that the file is valid and that every code file, agent, folder, channel, collection, field, board and column it names exists. While it has problems, Test and Activate are unavailable.
To try a version, active or not:
- Open the flow and choose Test.
- Under Test with, choose what the test starts with: inputs you fill in, a file you choose, a request body you paste, or the input of a past run.
- Choose Start test.
A test run acts as you and your budget pays for it. What it leaves alone:
- Posts and emails aren’t delivered; the run shows what would have been sent.
- Questions come to you, whoever they name.
- Files it saves stay in the run, not in the space.
- Steps that call outside Ivy make real calls, so only a space admin can test them.
Test runs are listed only for you, raise no notices, don’t count towards pausing and are kept for 7 days.
Activate it
- Open the flow and choose Activate.
- Read What it can reach: who it acts as, where it posts, whom it asks, what it reads and saves, and the hosts and AI models it may use.
- Choose Activate.
Changing any of this later needs a new version and a new activation. A newer version of an active flow doesn’t run until you choose Activate this version.
Who may activate
Space editors and admins activate. Agents never activate: the assistant and space agents write the file in their sandbox, see its problems in the result each time they save it, and can check a draft before saving it. When an agent’s save changes what runs after what, the result says so in plain words, such as “‘Pay’ now runs after ‘Check’ instead of ‘Approve’.”, and so does the check. API keys can write the file and check it through the API, but never activate it either. A space admin is needed, and confirms their identity again, when the version:
- starts on a webhook;
- starts on incoming email;
- sends email;
- lets code reach the network;
- writes into a connected drive;
- uses a connection;
- saves files into another space;
- takes an action in another service.
Code reaches only hosts that an organisation admin has allowed for the space. Where plans apply, the plan limits how many flows can be active in the organisation.
An agent that wrote or changed a flow can ask, in its conversation, for the saved version to be activated. The request shows the version, the one it replaces and what the flow reaches, and anyone who may activate that version answers it there, or in a Slack or Teams channel the conversation is mirrored to. A version that needs a space admin is activated only in Ivy, after they confirm their identity; Slack and Teams show a link to it. Saving the file again makes an open request out of date.
Deactivate it
Deactivate stops new runs at once. It starts no new runs. Its triggers, webhook addresses and secrets are kept, so you can activate it again. Runs that are already going continue unless you cancel them.
Who a run acts as
| Started by | The run acts as |
|---|---|
| A person choosing Run | That person |
| A person answering a question | That person |
| An API key | The key’s service identity |
| A schedule, a webhook, a file or another event | The space identity |
The space identity is a service identity that Ivy creates for the space when one of its flows first needs it. It is an editor of that space only and has no API keys. Nobody is present during its runs, so an agent’s deletions and overwrites are skipped and listed in the result.
Activation fails while the space identity can’t reach a file, folder or channel the version uses. A test run doesn’t show this, because it acts as you. A flow that asks or emails people can only be started by a person, not by an API key.
Follow its status and runs
The line under a flow’s name, and its row in the list, says when it last ran and how that ended, when it runs next, and why it is paused. Its status is Active, Inactive, Paused or Blocked.
While a run hasn’t finished, the flow’s header says how it is doing, such as “Running · step 3 of 5” or “Waiting for Dana · 2h”, and Show on steps draws that run on the steps. In the list of flows, a flow whose run asks you something shows Waiting for you, which opens that run with the question.
Steps can keep values for later runs with set_state. A space admin sees them under More actions in the flow’s header, in Saved values: each value with the step that wrote it and its run. Clear saved values removes them all.
Runs started by a schedule or a file are readable by the space’s members, and a run you started by hand by you. Of other runs, such as a webhook’s, space admins see only that they happened and how their steps ended.
See a run on the steps
Runs are drawn on the flow’s steps. If you may edit the flow, it opens ready to edit, with its last run named above the steps: Show on steps draws it, and Back to editing returns to editing. Otherwise it opens with its latest run drawn. A link to a run, such as one in a notice or on a record, opens the flow with that run drawn.
Run history, above the steps, lists every run, newest first; Show older runs loads older ones. You can show only runs of one status under Status (Waiting runs, Failed runs, Succeeded runs or your Test runs), only those started one way under Started by, and only those of the last 24 hours, 7 days or 30 days under Date. Each run shows its status, when it started, what started it and who, how long it took and its credits. Choose one to draw it on the steps.
Above the steps, a drawn run shows its status, what started it, who and when, how long it took and its credits, and says when it was a test run, when it failed and when its content is hidden from you. Run again, on a run a record started, starts the same trigger again, Cancel run stops a run that is still going, and Hide run takes the run off the steps. Each card shows its step’s status and how long it took. Choose a step to see its details in the step panel: its input (Input), its output, the Logs of a code step, its credits, its error and the question of an ask step.
When a run waits for a person
A run waiting for a person says so above the steps, with Go to the question, and under the card of the ask step it waits at, whom it waits for and since when. If it waits for you, the question is right there, with its buttons or answer field; answering it there is the same as answering in the conversation, the channel, Slack or Teams, or Activity. Otherwise Open question opens it where it was asked, if you can read it there, and space admins can choose Remind to notify the people it waits for again, at most once an hour.
Get notices
Turn on Follow on a flow to get its notices; whoever activates it follows it. Failed runs and pauses also go to the space’s admins. Every notice about a flow you follow lands in Ivy. Choose whether it also reaches you elsewhere, and how often. A file can name a channel under notify: that gets a copy of failures and pauses.
Run from here
When a run failed at a step, or you want a step to do its work again, you can start a new run from that step instead of from the beginning: draw the run on the steps, choose the step, and choose Run from here in its panel. The new run reuses what the steps before it did in the old run, their results and the files they saved, without doing their work again, so nothing is posted, asked or saved twice. The chosen step and the steps after it run again, and so do steps that ran at the same time as it.
- The run must have ended, and every step before the chosen one must have finished in it.
- It uses the same version of the flow, so that version must still be the active one.
- What the reused steps worked with must not have changed: the file that started the run, and the files the reused steps read, must be as they were, and what they did must still be kept, not erased. Otherwise Ivy says why and offers Run again from the start instead.
- A run that acted as a person can be run from a step only by that person, because the new run acts as them too.
- Test runs can’t; start a new test run from the editor instead.
- The new run counts towards the flow’s runs at the same time: if the flow is already running as often as it may, try again when a run ends.
- The new run shows each step it reused as Reused from the run on …, with that run’s date.
- Erasing the old run also erases what the new run copied from it.
When a flow is paused
A paused flow starts no runs and shows the reason:
| Reason shown | What to do |
|---|---|
| Paused after several failed runs in a row. | Three runs in a row failed. Open them, fix the cause, then resume. |
| Paused because the budget is used up. | Ask an organisation admin to raise the budget, then resume. |
| Paused because the space identity was turned off. | Ask an organisation admin to turn the space identity on again, then resume. |
| Paused after too many runs in one hour, which may be a loop. | A file or record trigger started over 60 runs in an hour. Check that the flow doesn’t react to files it writes or to changes another flow makes in reply, then resume. |
| Paused because its file or active version no longer exists. | It can’t be resumed: activate a version of the file again. |
| An organisation admin paused it. | Only an organisation admin can resume it. |
A space editor or admin resumes with Resume in the notice at the top of the flow.
Use connections and secrets
Where the installation has connections turned on, a code step can call an outside service with an API key that never reaches the code.
- Declare the connection in a file named
connections.ivy.yamlat the root of the space: its name, its hosts and how the value is sent, never the value itself. - A space admin opens Connections from the Flows section and chooses Set value. Once saved, nobody can view the value again.
- Name the connection on the code step that uses it. Activating that version needs a space admin.
Rotate replaces a value from the next request on. When a connection’s declaration changes after its value was set, the value isn’t used until a space admin chooses Confirm. Deleting a value pauses the flows that use it until a new one is set.
For a service that issues access tokens with the OAuth client-credentials grant, such as Microsoft Graph, declare oauth2_client_credentials with the service’s token URL:
ivy: connections/v1
connections:
graph:
description: Microsoft Graph for the standup digest
hosts: [graph.microsoft.com]
auth:
oauth2_client_credentials:
token_url: https://login.microsoftonline.com/<tenant>/oauth2/v2.0/token
scope: https://graph.microsoft.com/.default
A space admin then enters the client ID and the client secret instead of a single value. Ivy gets the access token from the token endpoint itself and adds it to requests; the code never sees the ID, the secret or the token. The token endpoint’s host, here login.microsoftonline.com, must be allowed for the space.
GitHub App connections
A connection can act as a GitHub App, so code can open pull requests or comment on issues without anyone’s personal token.
-
Declare it with
github_app: the app’s ID, its installation ID, the permissions its tokens are narrowed to and, optionally, the repositories they cover (all of the installation’s when left out). For GitHub Enterprise Server, addserver:with its host and declare that host.ivy: connections/v1 connections: github: hosts: [api.github.com, github.com] auth: github_app: app_id: 123456 installation_id: 7890123 repositories: [ivy] permissions: contents: write pull_requests: write -
As the value, a space admin pastes the app’s whole private key, the
.pemfile from the app’s settings on GitHub. Ivy only ever exchanges it for short-lived installation tokens; neither the key nor a token reaches the code. -
Code calls the REST API under
$IVY_CONNECTIONS_URL/github/and uses git through$IVY_CONNECTIONS_URL/github@github.com/:curl "$IVY_CONNECTIONS_URL/github/repos/<owner>/<repo>/pulls" git clone "$IVY_CONNECTIONS_URL/github@github.com/<owner>/<repo>.git"
Never give the app the Workflows, Administration or Secrets permissions. The check refuses them in the declaration, but the app itself shouldn’t have them either.
Edit in the visual view
Where the installation has authoring turned on, the flow page is drawn exactly from the file: its triggers, then its steps as cards from top to bottom, each with its name in plain words. Editors add, edit and remove triggers and steps there, starting with Add trigger and Add step, and choose Save version to save a new version of the file. Run history draws a run on the cards, with each step’s status.
A step with problems shows them on its card, each with Show in code, which opens the file with Code at that line.
Where paths aren’t on, Runs after on a step’s card chooses the one step it follows, and the step moves there in the list.
If someone else saved the flow while you were editing, Ivy tells you before it saves and doesn’t overwrite their version.
See the paths
A flow without paths is a single column of cards. Where it has paths, the view shows them side by side:
- After a decision or a question, its paths stand next to each other as columns, each headed with its name, such as “Approved” and “Rejected”, and they meet again at the next card that all of them lead to.
- Steps that run at the same time stand next to each other under At the same time.
- A step with an if this fails path shows it as a small label beside its card.
- On a phone you see one path at a time and switch between them with the buttons above it.
Draw a run or a test run on the steps, and each card shows its status and how long it took.
Change the order and the paths
Each change is written into the flow file, and Save version saves a new version.
- Move a step: drag its card to another place on the same path, onto another path, below the point where the paths meet, or into a group of steps that run at the same time. A decision or a question moves together with its paths. Where a step can’t go, Ivy says why. With the keyboard, Alt and the up or down arrow move the focused card; Move to… on the card’s menu lists every place it can go. On a phone, touch and hold a card to move it.
- Undo a move with the button in the message that confirms it, or with Ctrl+Z (Cmd+Z on a Mac).
- Runs after on a step’s card ticks the steps it runs after and the path from each, such as a decision’s path or If it fails.
- If this fails on a step’s card chooses what happens when it fails: stop the flow, carry on, or do something else, which adds a step for it.
- Insert value: a step’s fields offer the values of the steps it runs after, such as the total read from an invoice, so you don’t type
{{ steps.read.output.total }}. A value from a step that may not have run is marked as possibly empty. A condition is built from a value, a comparison and another value, and you can still edit it as text.
Moving a step never changes silently what runs after what: the steps that came after it now run after the step that came before it, and Ivy writes after: in the file wherever it’s needed to keep that.
For organisation admins
Organisation admins see every activated flow under Flows: its name, space, triggers and status, never its prompts or code. Deactivate and block stops one; then only an organisation admin can choose Allow again, after which an editor can activate it. The space identity’s budget and status are set under service identities.