The WorkflowSummary object
idstringrequiredwf_ followed by 26 characters.
namestringrequireddescriptionstringtrigger_typestringrequiredmanualschedulewebhookenabledbooleanrequiredWhether its schedule or webhook fires. Every workflow can be run by hand, enabled or not.
step_countintegerrequiredIts steps, those inside loops too.
methodsarray of stringrequiredThe slugs of the methods its steps run.
last_runobject or nullrequiredShow child attributesHide child attributes
idstringstatusstringcreated_atstringstarted_atstring or nullfinished_atstring or null
costobjectrequiredThe price of one run, in credits: the credits field for the method, AI, transform, email and webhook steps outside a For each, and per_item more for each item a For each takes (the most an item costs: a For each inside it counts at its max items). It is the full run: only steps that run and succeed are charged, so a run a filter ends early, or whose steps fail, costs less. per_item is null without a For each.
Show child attributesHide child attributes
creditsintegerrequiredper_iteminteger or nullrequired
next_run_atstring or nullAn enabled schedule: when it runs next.
created_atstringupdated_atstring
The Workflow object
Every field of WorkflowSummary, and the fields below, which are new or read differently.
step_countintegerIts steps, those inside loops too.
methodsarray of stringThe slugs of the methods its steps run.
last_runobject or nullShow child attributesHide child attributes
idstringstatusstringcreated_atstringstarted_atstring or nullfinished_atstring or null
costobjectThe price of one run, in credits: the credits field for the method, AI, transform, email and webhook steps outside a For each, and per_item more for each item a For each takes (the most an item costs: a For each inside it counts at its max items). It is the full run: only steps that run and succeed are charged, so a run a filter ends early, or whose steps fail, costs less. per_item is null without a For each.
Show child attributesHide child attributes
creditsintegerrequiredper_iteminteger or nullrequired
definitionobjectrequiredA trigger, then steps. Text in a method’s input, a loop’s over, an email and a webhook may hold templates: {{trigger.<key>}}, {{steps.<key>.<path>}}, {{loop.item}}, {{loop.index}}, {{run.id}}, {{run.started_at}}, {{now}}, {{previous.steps.<key>.<path>}} (the workflow’s last successful run; null on a first run), with filters ({{steps.search.data.results | length}}). A text that is exactly one template keeps the value’s type; a path that leads nowhere is null. A transform’s code reads the same data as data.trigger, data.steps.<key>, data.loop and data.previous.
Show child attributesHide child attributes
triggerobjectrequiredShow child attributesHide child attributes
typestringrequiredEvery workflow can also be run by hand with POST /v1/workflows/{id}/runs.
manualschedulewebhookinputsarray of objectWhat a run takes, read as {{trigger.<key>}}.
Show child attributesHide child attributes
keystringrequiredlabelstringtypestringrequiredstringnumberbooleanrequiredbooleandefaultstring or number or boolean or nulldescriptionstring
scheduleobjecttype schedule only.
Show child attributesHide child attributes
frequencystringrequiredminutes: every N minutes; hourly: every N hours; daily, weekly and monthly: at
at, every N days, weeks or months; weekdays: Monday to Friday atat.minuteshourlydailyweekdaysweeklymonthlyeveryintegerN. Not used by weekdays: leave it out or send 1.
atstringHH:MM, daily, weekdays, weekly and monthly.
dayintegermonthly: the day of the month, 1 to 31, or -1 for the last day (default 1). A day a month does not have (31 in April, 30 in February) is its last day.
weekdayintegerweekly: 0 is Sunday.
timezonestringAn IANA time zone, like Europe/Prague. Default UTC.
inputobjectThe input a scheduled run takes.
stepsarray of objectrequiredAny number of steps, loops nested as deep as needed; the definition is at most 200 KB.
Show child attributesHide child attributes
keystringUnique in the whole workflow; what templates (steps.<key>) and code (data.steps.<key>) read the step’s output by. Left out, it is made from the name (List invoices: list_invoices).
namestringPlain words a person reads.
typestringrequiredmethodaitransformfilterloopdelayemailwebhookmethodstring or nullmethod: the method’s slug; null while its method is pending.
pendingobjectmethod: a method your organization does not have yet. The workflow cannot run or be turned on while a step is pending: accept building it with POST /v1/workflows/{id}/steps/{key}/build (status building, then the step runs the new method, its input and the later steps wired to it by AI). failed: reason says why the build did not make it; building again tries again.
Show child attributesHide child attributes
needstringrequiredWhat the method does, in plain words.
build_promptstringrequiredWhat the builder is asked to make.
sitestring or nullThe website to build on (a domain or sign-in host). Without one the step cannot be built (409 site_required) and is listed in incomplete; send site to POST /v1/workflows/{id}/steps/{key}/build.
build_idstring or nullrequiredIts build, once accepted.
statusstringrequiredproposedbuildingfailedreasonstringfailed: why.
inputJSON valuemethod: its input, an object; any value may be a template. A required input left empty makes the workflow incomplete until it is filled in. ai: more data its prompt is about, a template or an object of them, sent with the prompt; null (default): the prompt alone. Writing the data’s templates in the prompt itself does the same.
connectionstring or nullmethod: the conn_ id to run with; null for the site’s default.
on_errorstringmethod: stop (default) fails the run; continue records the failure and goes on.
stopcontinueinstructionstringtransform: what the step does, in plain words. Change it and send the code as it was saved (or empty), and the code is written again from it when the workflow is saved; code you changed is kept.
codestringtransform: the body of function (data, stop) that returns the step’s output (JSON). data is {trigger, steps: {<key>: output}, loop?: {item, index}, previous: the workflow’s last successful run before this one as {run_id, finished_at, trigger, steps: {<key>: output}}, or null on its first run, state: the step’s own memory across runs, an object ({} at first) that the next run starts from as this code leaves it once its run completes (top-level transforms; at most 256 KB; the ids already seen, for “only new items”)}; stop(reason) ends the run quietly, successful, like a filter (inside a loop: skips the rest of that item); prefer a filter step for conditions it can test. It runs in an isolated JavaScript sandbox: no network, files or modules, 2 seconds and 64 MB at most. Sent empty with an instruction, Fous writes it with AI when the workflow is saved; code you write is kept as written.
promptstringai: what to write or decide, in plain words; templates read the data (a list, an object or a long text a template writes in is sent as the prompt’s data, so the prompt’s own words are never cut). A model answers on every run: it reads about 10,000 tokens (prompt and data; longer data is shortened, and the model is told) and writes up to about 800 words. Output: {text}, or with fields an object with each field’s text. A failed answer (the model declined, ran out of room, or did not answer) fails the step and costs nothing.
fieldsarray of stringai: answer these fields (short text each) instead of one text, read as {{steps.<key>.<field>}}. Default [].
conditionsarray of objectfilter: what must hold for the run to go on. value is a template; op one of exists, not_exists (empty: null, "", [] or {}), equals, not_equals, contains, not_contains (text in any case; a list by its items), gt, gte, lt, lte (numbers, a numeric text too; a list by its length); compare is text or a template, for the operators that compare. When the filter does not pass, its record is filtered with output {passed: false, message: "Stopped: …", skipped: the action steps it skipped}.
Show child attributesHide child attributes
valuestringrequiredopstringrequiredexistsnot_existsequalsnot_equalscontainsnot_containsgtgteltltecomparestring
matchstringfilter: all (default) of its conditions, or any one.
allanyoverstringloop: a template that gives a list (a text is split at commas and new lines).
maxintegerloop: at most this many items (the rest are left out): any number, each item’s action steps costing credits. Left out: 10, and 5 on Free.
stepsarray of objectloop: its steps.
Show child attributesHide child attributes
keystringUnique in the whole workflow; what templates (steps.<key>) and code (data.steps.<key>) read the step’s output by. Left out, it is made from the name (List invoices: list_invoices).
namestringPlain words a person reads.
typestringrequiredmethodaitransformfilterloopdelayemailwebhookmethodstring or nullmethod: the method’s slug; null while its method is pending.
pendingobjectmethod: a method your organization does not have yet. The workflow cannot run or be turned on while a step is pending: accept building it with POST /v1/workflows/{id}/steps/{key}/build (status building, then the step runs the new method, its input and the later steps wired to it by AI). failed: reason says why the build did not make it; building again tries again.
inputJSON valuemethod: its input, an object; any value may be a template. A required input left empty makes the workflow incomplete until it is filled in. ai: more data its prompt is about, a template or an object of them, sent with the prompt; null (default): the prompt alone. Writing the data’s templates in the prompt itself does the same.
connectionstring or nullmethod: the conn_ id to run with; null for the site’s default.
on_errorstringmethod: stop (default) fails the run; continue records the failure and goes on.
stopcontinueinstructionstringtransform: what the step does, in plain words. Change it and send the code as it was saved (or empty), and the code is written again from it when the workflow is saved; code you changed is kept.
codestringtransform: the body of function (data, stop) that returns the step’s output (JSON). data is {trigger, steps: {<key>: output}, loop?: {item, index}, previous: the workflow’s last successful run before this one as {run_id, finished_at, trigger, steps: {<key>: output}}, or null on its first run, state: the step’s own memory across runs, an object ({} at first) that the next run starts from as this code leaves it once its run completes (top-level transforms; at most 256 KB; the ids already seen, for “only new items”)}; stop(reason) ends the run quietly, successful, like a filter (inside a loop: skips the rest of that item); prefer a filter step for conditions it can test. It runs in an isolated JavaScript sandbox: no network, files or modules, 2 seconds and 64 MB at most. Sent empty with an instruction, Fous writes it with AI when the workflow is saved; code you write is kept as written.
promptstringai: what to write or decide, in plain words; templates read the data (a list, an object or a long text a template writes in is sent as the prompt’s data, so the prompt’s own words are never cut). A model answers on every run: it reads about 10,000 tokens (prompt and data; longer data is shortened, and the model is told) and writes up to about 800 words. Output: {text}, or with fields an object with each field’s text. A failed answer (the model declined, ran out of room, or did not answer) fails the step and costs nothing.
fieldsarray of stringai: answer these fields (short text each) instead of one text, read as {{steps.<key>.<field>}}. Default [].
conditionsarray of objectfilter: what must hold for the run to go on. value is a template; op one of exists, not_exists (empty: null, "", [] or {}), equals, not_equals, contains, not_contains (text in any case; a list by its items), gt, gte, lt, lte (numbers, a numeric text too; a list by its length); compare is text or a template, for the operators that compare. When the filter does not pass, its record is filtered with output {passed: false, message: "Stopped: …", skipped: the action steps it skipped}.
matchstringfilter: all (default) of its conditions, or any one.
allanyoverstringloop: a template that gives a list (a text is split at commas and new lines).
maxintegerloop: at most this many items (the rest are left out): any number, each item’s action steps costing credits. Left out: 10, and 5 on Free.
stepsarray of objectloop: its steps.
secondsintegerdelay.
tostringemail: addresses separated by commas; empty: the workflow is saved incomplete until it is filled in. On Free, Starter and Pro, only people in your organization (their sign-in addresses); on Business and Enterprise, anyone. It comes from "<workflow name> via Fous" <workflows@fous.com>, and replies go to the person who made the workflow.
subjectstringemail.
bodyJSON valueemail: the plain-text body (line breaks kept). webhook: the JSON to send, a template or an object of them; left out, the previous step’s output.
urlstringwebhook: a public https address; empty: the workflow is saved incomplete until it is filled in. Each POST carries X-Fous-Workflow, X-Fous-Run, X-Fous-Signature (t=<unix seconds>,v1=<HMAC-SHA256 in hex of "<t>.<body>" with the workflow’s signing_secret>) and an Idempotency-Key that is the same on every attempt of the step (receivers dedupe on it: Fous retries on 5xx, 408, 429 and connection failures, and a run taken up again sends what it recorded under it; one that got no answer in time is not sent again), plus the step’s headers.
headersarray of objectwebhook: headers sent with each POST, for a receiver that needs a key or a token (Authorization, X-API-Key). Their values are write-only secrets: sent as value to set one (empty text clears it), left out to keep the saved one; answers and run records never hold them, only a masked hint (null: no value yet, and the workflow is incomplete until it has one). Not Host, Content-Type, Content-Length, Idempotency-Key, Connection, Transfer-Encoding or X-Fous-*.
secondsintegerdelay.
tostringemail: addresses separated by commas; empty: the workflow is saved incomplete until it is filled in. On Free, Starter and Pro, only people in your organization (their sign-in addresses); on Business and Enterprise, anyone. It comes from "<workflow name> via Fous" <workflows@fous.com>, and replies go to the person who made the workflow.
subjectstringemail.
bodyJSON valueemail: the plain-text body (line breaks kept). webhook: the JSON to send, a template or an object of them; left out, the previous step’s output.
urlstringwebhook: a public https address; empty: the workflow is saved incomplete until it is filled in. Each POST carries X-Fous-Workflow, X-Fous-Run, X-Fous-Signature (t=<unix seconds>,v1=<HMAC-SHA256 in hex of "<t>.<body>" with the workflow’s signing_secret>) and an Idempotency-Key that is the same on every attempt of the step (receivers dedupe on it: Fous retries on 5xx, 408, 429 and connection failures, and a run taken up again sends what it recorded under it; one that got no answer in time is not sent again), plus the step’s headers.
headersarray of objectwebhook: headers sent with each POST, for a receiver that needs a key or a token (Authorization, X-API-Key). Their values are write-only secrets: sent as value to set one (empty text clears it), left out to keep the saved one; answers and run records never hold them, only a masked hint (null: no value yet, and the workflow is incomplete until it has one). Not Host, Content-Type, Content-Length, Idempotency-Key, Connection, Transfer-Encoding or X-Fous-*.
Show child attributesHide child attributes
namestringrequiredvaluestringSent only: the value to save.
hintstring or nullThe saved value masked (its last 4 characters when long), or null.
incompletearray of objectValues the workflow still needs before it can run or be turned on: an empty webhook address (field url), an email with no one to send it to (to), a method’s required input left empty (input.<name>). A workflow is saved with them empty.
Show child attributesHide child attributes
keystringrequiredThe step.
fieldstringrequiredmessagestringrequiredWhat to do, in plain words.
webhook_urlstring or nullrequiredA webhook workflow: where a POST starts a run. The address is the secret; renew it with POST /v1/workflows/{id}/webhook.
signing_secretstring or nullA workflow with webhook steps: what they sign their calls with (X-Fous-Signature), so the address can check the call is from Fous. New one with POST /v1/workflows/{id}/signing-secret.
The WorkflowRun object
idstringrequiredwfr_ followed by 26 characters.
workflow_idstringrequiredstatusstringrequiredwaiting: until resume_at, on a delay, to try a step again, for a method’s repair, or (a scheduled run) for someone to sign an account in again (the step’s waiting says which). A run a filter (or stop()) ended early completed: that step is recorded filtered, saying why. skipped: its schedule came due while the last run had not finished; error says which (code previous_run_open, run_id). canceled: by a person, or the workflow was turned off (its schedule’s and webhook’s runs that had not started, or were waiting to retry a step or for a repair).
queuedrunningwaitingcompletedfailedcanceledskippedtriggerstringrequiredmanualschedulewebhookapiinputobjectWhat it was given, checked against the trigger’s inputs.
errorobject or nullA failed run: the failed step’s error, with step and path.
creditsintegerrequiredWhat the run cost, in credits: 1 for each method, AI, transform, email and webhook step that ran and completed (those in a For each once per item). Steps a filter skipped, failed attempts and failed steps cost nothing. A step the organization cannot pay for fails with error.code insufficient_credits, and the run stops there.
created_atstringstarted_atstring or nullfinished_atstring or nullresume_atstring or nulloutputJSON valueWith steps, once the run completed: what the last step that did something gave (a method’s data, any other step’s output). Null before it completed.
stepsarray of objectEach step as it ran, in the order it started.
Show child attributesHide child attributes
seqintegerrequiredkeystringrequiredpathstringrequiredWhere it ran: "send" at the top, "loop.send[2]" in a loop’s third item.
typestringrequiredmethodaitransformfilterloopdelayemailwebhooknamestringstatusstringrequiredwaiting: to be tried again, for its method’s repair, or for someone to sign its account in again (waiting says which and until when). filtered: a filter that did not pass, or a transform that called stop(); what came after it in its block did not run.
runningwaitingcompletedfailedfilteredinputJSON valueWhat it was given, its templates resolved (dropped with the run’s data when it expires: 24 hours or the plan’s run history; the workflow’s latest completed run keeps it). ai: {prompt (as sent, up to 20,000 characters), shortened?: true when long texts or lists in its data were shortened to fit, left_out?: items of its data not shown (the model is told how many)}; filter: {conditions} with the values compared.
attemptsarray of objectIts failed attempts, in order: {attempt, at, error: {code, message}, run_id? (a method step’s run)}.
waitingobject or nullWhile it waits (status waiting): reason retry (until: the next try; attempt and of: "attempt 2 of 5"), repair (until: the next look; method; repair_until: when its repair is due, null when not known yet) or connection (a scheduled run whose account needs signing in: it goes on as soon as someone signs in; until: the next look, a day at most; site, connection_id and connect_url say where); since: when it began waiting; message, in plain words.
outputJSON valuemethod: {status, data, run_id, error}; ai: {text}, or its fields; transform: what its code returned ({stopped: true, message: "Stopped: …", skipped} when it called stop()); filter: {passed: true}, or {passed: false, message: "Stopped: …", skipped: how many action steps it skipped, which cost nothing}; loop: {count, items: [{status: done or filtered}]} (each item’s outputs are its steps’ records); delay: {seconds}; email: {sent}; webhook: {status, body} (body up to 64 KB).
errorobject or nullmethod_run_idstring or nullmethod: its run, also in GET /v1/runs.
started_atstring or nullfinished_atstring or null
List workflows
Your organization’s workflows, the latest change first, each with its trigger, the methods its steps run and its last run. Free.
Create a workflow
Saves a workflow, from a prompt or from a definition. With {prompt}, AI reads your methods (their inputs and outputs), picks the ones the request needs, wires their inputs, writes the code of its transforms and saves the workflow turned off; ai.summary says what it built. What the request needs that none of your methods can do becomes a pending method step (method null, pending {need, build_prompt}) and is listed in ai.missing: accept building it with POST /v1/workflows/{id}/steps/{key}/build. A value the AI cannot know (a webhook address, an email address, an ID of your own) is left empty and listed in incomplete; the AI builds with sensible defaults rather than asking, and its summary says what is left to fill in. A prompt that asks for no automation ("hi", "what can you do?") saves nothing: the answer is 200 {workflow: null, ai} with ai.reply. When a step needs a website or account the AI cannot know ("our supplier portal", "our bank"), it asks instead: 200 {workflow: null, ai} with ai.question; send the conversation again as messages with the person's answer last. timezone (optional) is the person's, for times like "9am". With {name, definition}, the definition is checked against your methods: every problem answers at once in errors, each at its place (steps[2].input.query); a transform with an instruction and empty code gets its code written. Each method step is an ordinary run. A run costs 1 credit for each step that runs (methods, AI, transforms, emails and webhooks; steps inside For each once per item). The number shown before you run (cost) is the full run; a run a filter ends early costs less. Triggers, For each, filters and delays are free; failed steps cost nothing. A step whose failure can pass (the site or Fous failing for a moment, a rate limit) is tried again after 20 s, 2 min, 10 min and 30 min, 5 attempts in all; a method step whose method Fous is repairing waits for the repair. enabled (default false) turns on a schedule or a webhook, which need a paid plan. With Accept: text/event-stream the answer is Server-Sent Events while the AI writes, each event: <name> with data: <JSON>: status {text} (a short phase line); reply {text} (the next piece of a reply: append the pieces); question {text, options: [{label, value}], placeholder, allow_other} (the reply asks the person to choose, such as which site; show it as a card, and send the choice as the next message); workflow {name, description}, trigger {trigger} and step {index, step} (emitted as each top-level step is completed, in order; loops are emitted with all nested steps included; keys may still be missing) while it builds or changes the workflow; reset {} (the initial draft failed validation and the AI is restarting: discard earlier streamed events); then done with the same body the JSON answer has (the workflow and ai), or error with the error object. The stream’s HTTP status is 200 like the JSON answer’s.
Request body
Required, JSON. One of:
From a prompt
promptstringmessagesarray of objectShow child attributesHide child attributes
rolestringrequireduserassistanttextstringrequired
timezonestringAn IANA time zone, like Europe/Prague. Default UTC.
From a definition
namestringrequireddescriptionstringdefinitionobjectrequiredA trigger, then steps. Text in a method’s input, a loop’s over, an email and a webhook may hold templates: {{trigger.<key>}}, {{steps.<key>.<path>}}, {{loop.item}}, {{loop.index}}, {{run.id}}, {{run.started_at}}, {{now}}, {{previous.steps.<key>.<path>}} (the workflow’s last successful run; null on a first run), with filters ({{steps.search.data.results | length}}). A text that is exactly one template keeps the value’s type; a path that leads nowhere is null. A transform’s code reads the same data as data.trigger, data.steps.<key>, data.loop and data.previous.
Show child attributesHide child attributes
triggerobjectrequiredShow child attributesHide child attributes
typestringrequiredEvery workflow can also be run by hand with POST /v1/workflows/{id}/runs.
manualschedulewebhookinputsarray of objectWhat a run takes, read as {{trigger.<key>}}.
Show child attributesHide child attributes
keystringrequiredlabelstringtypestringrequiredstringnumberbooleanrequiredbooleandefaultstring or number or boolean or nulldescriptionstring
scheduleobjecttype schedule only.
Show child attributesHide child attributes
frequencystringrequiredminutes: every N minutes; hourly: every N hours; daily, weekly and monthly: at
at, every N days, weeks or months; weekdays: Monday to Friday atat.minuteshourlydailyweekdaysweeklymonthlyeveryintegerN. Not used by weekdays: leave it out or send 1.
atstringHH:MM, daily, weekdays, weekly and monthly.
dayintegermonthly: the day of the month, 1 to 31, or -1 for the last day (default 1). A day a month does not have (31 in April, 30 in February) is its last day.
weekdayintegerweekly: 0 is Sunday.
timezonestringAn IANA time zone, like Europe/Prague. Default UTC.
inputobjectThe input a scheduled run takes.
stepsarray of objectrequiredAny number of steps, loops nested as deep as needed; the definition is at most 200 KB.
Show child attributesHide child attributes
keystringUnique in the whole workflow; what templates (steps.<key>) and code (data.steps.<key>) read the step’s output by. Left out, it is made from the name (List invoices: list_invoices).
namestringPlain words a person reads.
typestringrequiredmethodaitransformfilterloopdelayemailwebhookmethodstring or nullmethod: the method’s slug; null while its method is pending.
pendingobjectmethod: a method your organization does not have yet. The workflow cannot run or be turned on while a step is pending: accept building it with POST /v1/workflows/{id}/steps/{key}/build (status building, then the step runs the new method, its input and the later steps wired to it by AI). failed: reason says why the build did not make it; building again tries again.
Show child attributesHide child attributes
needstringrequiredWhat the method does, in plain words.
build_promptstringrequiredWhat the builder is asked to make.
sitestring or nullThe website to build on (a domain or sign-in host). Without one the step cannot be built (409 site_required) and is listed in incomplete; send site to POST /v1/workflows/{id}/steps/{key}/build.
build_idstring or nullrequiredIts build, once accepted.
statusstringrequiredproposedbuildingfailedreasonstringfailed: why.
inputJSON valuemethod: its input, an object; any value may be a template. A required input left empty makes the workflow incomplete until it is filled in. ai: more data its prompt is about, a template or an object of them, sent with the prompt; null (default): the prompt alone. Writing the data’s templates in the prompt itself does the same.
connectionstring or nullmethod: the conn_ id to run with; null for the site’s default.
on_errorstringmethod: stop (default) fails the run; continue records the failure and goes on.
stopcontinueinstructionstringtransform: what the step does, in plain words. Change it and send the code as it was saved (or empty), and the code is written again from it when the workflow is saved; code you changed is kept.
codestringtransform: the body of function (data, stop) that returns the step’s output (JSON). data is {trigger, steps: {<key>: output}, loop?: {item, index}, previous: the workflow’s last successful run before this one as {run_id, finished_at, trigger, steps: {<key>: output}}, or null on its first run, state: the step’s own memory across runs, an object ({} at first) that the next run starts from as this code leaves it once its run completes (top-level transforms; at most 256 KB; the ids already seen, for “only new items”)}; stop(reason) ends the run quietly, successful, like a filter (inside a loop: skips the rest of that item); prefer a filter step for conditions it can test. It runs in an isolated JavaScript sandbox: no network, files or modules, 2 seconds and 64 MB at most. Sent empty with an instruction, Fous writes it with AI when the workflow is saved; code you write is kept as written.
promptstringai: what to write or decide, in plain words; templates read the data (a list, an object or a long text a template writes in is sent as the prompt’s data, so the prompt’s own words are never cut). A model answers on every run: it reads about 10,000 tokens (prompt and data; longer data is shortened, and the model is told) and writes up to about 800 words. Output: {text}, or with fields an object with each field’s text. A failed answer (the model declined, ran out of room, or did not answer) fails the step and costs nothing.
fieldsarray of stringai: answer these fields (short text each) instead of one text, read as {{steps.<key>.<field>}}. Default [].
conditionsarray of objectfilter: what must hold for the run to go on. value is a template; op one of exists, not_exists (empty: null, "", [] or {}), equals, not_equals, contains, not_contains (text in any case; a list by its items), gt, gte, lt, lte (numbers, a numeric text too; a list by its length); compare is text or a template, for the operators that compare. When the filter does not pass, its record is filtered with output {passed: false, message: "Stopped: …", skipped: the action steps it skipped}.
Show child attributesHide child attributes
valuestringrequiredopstringrequiredexistsnot_existsequalsnot_equalscontainsnot_containsgtgteltltecomparestring
matchstringfilter: all (default) of its conditions, or any one.
allanyoverstringloop: a template that gives a list (a text is split at commas and new lines).
maxintegerloop: at most this many items (the rest are left out): any number, each item’s action steps costing credits. Left out: 10, and 5 on Free.
stepsarray of objectloop: its steps.
Show child attributesHide child attributes
keystringUnique in the whole workflow; what templates (steps.<key>) and code (data.steps.<key>) read the step’s output by. Left out, it is made from the name (List invoices: list_invoices).
namestringPlain words a person reads.
typestringrequiredmethodaitransformfilterloopdelayemailwebhookmethodstring or nullmethod: the method’s slug; null while its method is pending.
pendingobjectmethod: a method your organization does not have yet. The workflow cannot run or be turned on while a step is pending: accept building it with POST /v1/workflows/{id}/steps/{key}/build (status building, then the step runs the new method, its input and the later steps wired to it by AI). failed: reason says why the build did not make it; building again tries again.
inputJSON valuemethod: its input, an object; any value may be a template. A required input left empty makes the workflow incomplete until it is filled in. ai: more data its prompt is about, a template or an object of them, sent with the prompt; null (default): the prompt alone. Writing the data’s templates in the prompt itself does the same.
connectionstring or nullmethod: the conn_ id to run with; null for the site’s default.
on_errorstringmethod: stop (default) fails the run; continue records the failure and goes on.
stopcontinueinstructionstringtransform: what the step does, in plain words. Change it and send the code as it was saved (or empty), and the code is written again from it when the workflow is saved; code you changed is kept.
codestringtransform: the body of function (data, stop) that returns the step’s output (JSON). data is {trigger, steps: {<key>: output}, loop?: {item, index}, previous: the workflow’s last successful run before this one as {run_id, finished_at, trigger, steps: {<key>: output}}, or null on its first run, state: the step’s own memory across runs, an object ({} at first) that the next run starts from as this code leaves it once its run completes (top-level transforms; at most 256 KB; the ids already seen, for “only new items”)}; stop(reason) ends the run quietly, successful, like a filter (inside a loop: skips the rest of that item); prefer a filter step for conditions it can test. It runs in an isolated JavaScript sandbox: no network, files or modules, 2 seconds and 64 MB at most. Sent empty with an instruction, Fous writes it with AI when the workflow is saved; code you write is kept as written.
promptstringai: what to write or decide, in plain words; templates read the data (a list, an object or a long text a template writes in is sent as the prompt’s data, so the prompt’s own words are never cut). A model answers on every run: it reads about 10,000 tokens (prompt and data; longer data is shortened, and the model is told) and writes up to about 800 words. Output: {text}, or with fields an object with each field’s text. A failed answer (the model declined, ran out of room, or did not answer) fails the step and costs nothing.
fieldsarray of stringai: answer these fields (short text each) instead of one text, read as {{steps.<key>.<field>}}. Default [].
conditionsarray of objectfilter: what must hold for the run to go on. value is a template; op one of exists, not_exists (empty: null, "", [] or {}), equals, not_equals, contains, not_contains (text in any case; a list by its items), gt, gte, lt, lte (numbers, a numeric text too; a list by its length); compare is text or a template, for the operators that compare. When the filter does not pass, its record is filtered with output {passed: false, message: "Stopped: …", skipped: the action steps it skipped}.
matchstringfilter: all (default) of its conditions, or any one.
allanyoverstringloop: a template that gives a list (a text is split at commas and new lines).
maxintegerloop: at most this many items (the rest are left out): any number, each item’s action steps costing credits. Left out: 10, and 5 on Free.
stepsarray of objectloop: its steps.
secondsintegerdelay.
tostringemail: addresses separated by commas; empty: the workflow is saved incomplete until it is filled in. On Free, Starter and Pro, only people in your organization (their sign-in addresses); on Business and Enterprise, anyone. It comes from "<workflow name> via Fous" <workflows@fous.com>, and replies go to the person who made the workflow.
subjectstringemail.
bodyJSON valueemail: the plain-text body (line breaks kept). webhook: the JSON to send, a template or an object of them; left out, the previous step’s output.
urlstringwebhook: a public https address; empty: the workflow is saved incomplete until it is filled in. Each POST carries X-Fous-Workflow, X-Fous-Run, X-Fous-Signature (t=<unix seconds>,v1=<HMAC-SHA256 in hex of "<t>.<body>" with the workflow’s signing_secret>) and an Idempotency-Key that is the same on every attempt of the step (receivers dedupe on it: Fous retries on 5xx, 408, 429 and connection failures, and a run taken up again sends what it recorded under it; one that got no answer in time is not sent again), plus the step’s headers.
headersarray of objectwebhook: headers sent with each POST, for a receiver that needs a key or a token (Authorization, X-API-Key). Their values are write-only secrets: sent as value to set one (empty text clears it), left out to keep the saved one; answers and run records never hold them, only a masked hint (null: no value yet, and the workflow is incomplete until it has one). Not Host, Content-Type, Content-Length, Idempotency-Key, Connection, Transfer-Encoding or X-Fous-*.
secondsintegerdelay.
tostringemail: addresses separated by commas; empty: the workflow is saved incomplete until it is filled in. On Free, Starter and Pro, only people in your organization (their sign-in addresses); on Business and Enterprise, anyone. It comes from "<workflow name> via Fous" <workflows@fous.com>, and replies go to the person who made the workflow.
subjectstringemail.
bodyJSON valueemail: the plain-text body (line breaks kept). webhook: the JSON to send, a template or an object of them; left out, the previous step’s output.
urlstringwebhook: a public https address; empty: the workflow is saved incomplete until it is filled in. Each POST carries X-Fous-Workflow, X-Fous-Run, X-Fous-Signature (t=<unix seconds>,v1=<HMAC-SHA256 in hex of "<t>.<body>" with the workflow’s signing_secret>) and an Idempotency-Key that is the same on every attempt of the step (receivers dedupe on it: Fous retries on 5xx, 408, 429 and connection failures, and a run taken up again sends what it recorded under it; one that got no answer in time is not sent again), plus the step’s headers.
headersarray of objectwebhook: headers sent with each POST, for a receiver that needs a key or a token (Authorization, X-API-Key). Their values are write-only secrets: sent as value to set one (empty text clears it), left out to keep the saved one; answers and run records never hold them, only a masked hint (null: no value yet, and the workflow is incomplete until it has one). Not Host, Content-Type, Content-Length, Idempotency-Key, Connection, Transfer-Encoding or X-Fous-*.
Show child attributesHide child attributes
namestringrequiredvaluestringSent only: the value to save.
hintstring or nullThe saved value masked (its last 4 characters when long), or null.
enabledbooleandefaultfalseWhether its schedule or webhook fires.
Returns
- 200From a prompt, JSON or the event stream: the saved workflow with ai (it is saved turned off), or {workflow: null, ai} when it asks for no automation or the AI asks back; nothing was saved then.
- 201Saved from a definition.
Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_request | The definition (or the body) does not hold: errors lists each problem at its place |
| 402 | insufficient_credits | No credits left, and no extra credits on (or capped, or failing to charge); nothing starts |
| 403 | plan_limit | Schedules and webhooks come with a paid plan (limit.kind api); from a prompt, also the plan’s AI messages used (limit.kind chat_messages) |
| 409 | conflict | reason workflow_incomplete: a value is still to fill in (incomplete) or a step’s method still to build (steps), so the workflow cannot run or be turned on |
| 422 | invalid_input | reason ai_failed: the AI’s draft did not hold twice |
| 429 | rate_limited | Too many AI messages this minute (limit.kind chat_per_minute) |
| 503 | service_unavailable | The AI is unavailable: nothing was saved or changed |
Write a transform’s code
AI writes the JavaScript of one transform from its instruction, given the definition it is in (sent as it is, saved or not): it reads the step’s place, the trigger, the steps before it and their methods’ output schemas. Nothing is saved; saving a definition whose transform has an instruction and empty code does the same.
Request body
Required, JSON.
instructionstringrequireddefinitionobjectrequiredThe workflow’s definition.
step_keystringrequiredThe transform’s key in it.
Returns
- 200The code.
The answer has these fields:
codestringrequired
Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_request | The body does not hold, or the definition has no such step |
| 402 | insufficient_credits | No credits left, and no extra credits on (or capped, or failing to charge); nothing starts |
| 403 | plan_limit | The plan’s AI messages are used (limit.kind chat_messages; window: day or period): Free includes 40 in all and 15 a day, the paid plans more each month |
| 422 | invalid_input | The AI’s code did not hold twice |
| 429 | rate_limited | Too many AI messages this minute (limit.kind chat_per_minute) |
| 503 | service_unavailable | The AI is unavailable: nothing was saved or changed |
Get a workflow
The workflow with its definition, its webhook’s address, and incomplete: the values still to fill in before it can run. Free. While a step’s method is building (pending.status building), read it again every few seconds: once the build ends, the step runs the new method, or its pending.status is failed with the reason.
Path parameters
idstringrequired
Errors
| Status | Code | When |
|---|---|---|
| 404 | not_found | No such workflow |
Update a workflow
Changes any of name, description, definition and enabled, or asks the AI to change it: send {prompt} or {messages} (the conversation so far, newest last), with timezone if the workflow names a time. A new definition is checked as on create, and a transform with an instruction and empty code gets its code written, as does one whose instruction changed while its code is still the saved one; a run already going keeps the definition it started with. The AI’s change is saved the same way. With preview: true it is answered but not saved (a name and definition sent with it are the draft it reads); the AI that only answers (a question, or asking one back) changes nothing, and its words are in ai. With Accept: text/event-stream the answer streams while the AI writes (same 200, same body in done).
Path parameters
idstringrequired
Request body
Required, JSON.
namestringdescriptionstringdefinitionobjectA trigger, then steps. Text in a method’s input, a loop’s over, an email and a webhook may hold templates: {{trigger.<key>}}, {{steps.<key>.<path>}}, {{loop.item}}, {{loop.index}}, {{run.id}}, {{run.started_at}}, {{now}}, {{previous.steps.<key>.<path>}} (the workflow’s last successful run; null on a first run), with filters ({{steps.search.data.results | length}}). A text that is exactly one template keeps the value’s type; a path that leads nowhere is null. A transform’s code reads the same data as data.trigger, data.steps.<key>, data.loop and data.previous.
Show child attributesHide child attributes
triggerobjectrequiredShow child attributesHide child attributes
typestringrequiredEvery workflow can also be run by hand with POST /v1/workflows/{id}/runs.
manualschedulewebhookinputsarray of objectWhat a run takes, read as {{trigger.<key>}}.
Show child attributesHide child attributes
keystringrequiredlabelstringtypestringrequiredstringnumberbooleanrequiredbooleandefaultstring or number or boolean or nulldescriptionstring
scheduleobjecttype schedule only.
Show child attributesHide child attributes
frequencystringrequiredminutes: every N minutes; hourly: every N hours; daily, weekly and monthly: at
at, every N days, weeks or months; weekdays: Monday to Friday atat.minuteshourlydailyweekdaysweeklymonthlyeveryintegerN. Not used by weekdays: leave it out or send 1.
atstringHH:MM, daily, weekdays, weekly and monthly.
dayintegermonthly: the day of the month, 1 to 31, or -1 for the last day (default 1). A day a month does not have (31 in April, 30 in February) is its last day.
weekdayintegerweekly: 0 is Sunday.
timezonestringAn IANA time zone, like Europe/Prague. Default UTC.
inputobjectThe input a scheduled run takes.
stepsarray of objectrequiredAny number of steps, loops nested as deep as needed; the definition is at most 200 KB.
Show child attributesHide child attributes
keystringUnique in the whole workflow; what templates (steps.<key>) and code (data.steps.<key>) read the step’s output by. Left out, it is made from the name (List invoices: list_invoices).
namestringPlain words a person reads.
typestringrequiredmethodaitransformfilterloopdelayemailwebhookmethodstring or nullmethod: the method’s slug; null while its method is pending.
pendingobjectmethod: a method your organization does not have yet. The workflow cannot run or be turned on while a step is pending: accept building it with POST /v1/workflows/{id}/steps/{key}/build (status building, then the step runs the new method, its input and the later steps wired to it by AI). failed: reason says why the build did not make it; building again tries again.
Show child attributesHide child attributes
needstringrequiredWhat the method does, in plain words.
build_promptstringrequiredWhat the builder is asked to make.
sitestring or nullThe website to build on (a domain or sign-in host). Without one the step cannot be built (409 site_required) and is listed in incomplete; send site to POST /v1/workflows/{id}/steps/{key}/build.
build_idstring or nullrequiredIts build, once accepted.
statusstringrequiredproposedbuildingfailedreasonstringfailed: why.
inputJSON valuemethod: its input, an object; any value may be a template. A required input left empty makes the workflow incomplete until it is filled in. ai: more data its prompt is about, a template or an object of them, sent with the prompt; null (default): the prompt alone. Writing the data’s templates in the prompt itself does the same.
connectionstring or nullmethod: the conn_ id to run with; null for the site’s default.
on_errorstringmethod: stop (default) fails the run; continue records the failure and goes on.
stopcontinueinstructionstringtransform: what the step does, in plain words. Change it and send the code as it was saved (or empty), and the code is written again from it when the workflow is saved; code you changed is kept.
codestringtransform: the body of function (data, stop) that returns the step’s output (JSON). data is {trigger, steps: {<key>: output}, loop?: {item, index}, previous: the workflow’s last successful run before this one as {run_id, finished_at, trigger, steps: {<key>: output}}, or null on its first run, state: the step’s own memory across runs, an object ({} at first) that the next run starts from as this code leaves it once its run completes (top-level transforms; at most 256 KB; the ids already seen, for “only new items”)}; stop(reason) ends the run quietly, successful, like a filter (inside a loop: skips the rest of that item); prefer a filter step for conditions it can test. It runs in an isolated JavaScript sandbox: no network, files or modules, 2 seconds and 64 MB at most. Sent empty with an instruction, Fous writes it with AI when the workflow is saved; code you write is kept as written.
promptstringai: what to write or decide, in plain words; templates read the data (a list, an object or a long text a template writes in is sent as the prompt’s data, so the prompt’s own words are never cut). A model answers on every run: it reads about 10,000 tokens (prompt and data; longer data is shortened, and the model is told) and writes up to about 800 words. Output: {text}, or with fields an object with each field’s text. A failed answer (the model declined, ran out of room, or did not answer) fails the step and costs nothing.
fieldsarray of stringai: answer these fields (short text each) instead of one text, read as {{steps.<key>.<field>}}. Default [].
conditionsarray of objectfilter: what must hold for the run to go on. value is a template; op one of exists, not_exists (empty: null, "", [] or {}), equals, not_equals, contains, not_contains (text in any case; a list by its items), gt, gte, lt, lte (numbers, a numeric text too; a list by its length); compare is text or a template, for the operators that compare. When the filter does not pass, its record is filtered with output {passed: false, message: "Stopped: …", skipped: the action steps it skipped}.
Show child attributesHide child attributes
valuestringrequiredopstringrequiredexistsnot_existsequalsnot_equalscontainsnot_containsgtgteltltecomparestring
matchstringfilter: all (default) of its conditions, or any one.
allanyoverstringloop: a template that gives a list (a text is split at commas and new lines).
maxintegerloop: at most this many items (the rest are left out): any number, each item’s action steps costing credits. Left out: 10, and 5 on Free.
stepsarray of objectloop: its steps.
Show child attributesHide child attributes
keystringUnique in the whole workflow; what templates (steps.<key>) and code (data.steps.<key>) read the step’s output by. Left out, it is made from the name (List invoices: list_invoices).
namestringPlain words a person reads.
typestringrequiredmethodaitransformfilterloopdelayemailwebhookmethodstring or nullmethod: the method’s slug; null while its method is pending.
pendingobjectmethod: a method your organization does not have yet. The workflow cannot run or be turned on while a step is pending: accept building it with POST /v1/workflows/{id}/steps/{key}/build (status building, then the step runs the new method, its input and the later steps wired to it by AI). failed: reason says why the build did not make it; building again tries again.
inputJSON valuemethod: its input, an object; any value may be a template. A required input left empty makes the workflow incomplete until it is filled in. ai: more data its prompt is about, a template or an object of them, sent with the prompt; null (default): the prompt alone. Writing the data’s templates in the prompt itself does the same.
connectionstring or nullmethod: the conn_ id to run with; null for the site’s default.
on_errorstringmethod: stop (default) fails the run; continue records the failure and goes on.
stopcontinueinstructionstringtransform: what the step does, in plain words. Change it and send the code as it was saved (or empty), and the code is written again from it when the workflow is saved; code you changed is kept.
codestringtransform: the body of function (data, stop) that returns the step’s output (JSON). data is {trigger, steps: {<key>: output}, loop?: {item, index}, previous: the workflow’s last successful run before this one as {run_id, finished_at, trigger, steps: {<key>: output}}, or null on its first run, state: the step’s own memory across runs, an object ({} at first) that the next run starts from as this code leaves it once its run completes (top-level transforms; at most 256 KB; the ids already seen, for “only new items”)}; stop(reason) ends the run quietly, successful, like a filter (inside a loop: skips the rest of that item); prefer a filter step for conditions it can test. It runs in an isolated JavaScript sandbox: no network, files or modules, 2 seconds and 64 MB at most. Sent empty with an instruction, Fous writes it with AI when the workflow is saved; code you write is kept as written.
promptstringai: what to write or decide, in plain words; templates read the data (a list, an object or a long text a template writes in is sent as the prompt’s data, so the prompt’s own words are never cut). A model answers on every run: it reads about 10,000 tokens (prompt and data; longer data is shortened, and the model is told) and writes up to about 800 words. Output: {text}, or with fields an object with each field’s text. A failed answer (the model declined, ran out of room, or did not answer) fails the step and costs nothing.
fieldsarray of stringai: answer these fields (short text each) instead of one text, read as {{steps.<key>.<field>}}. Default [].
conditionsarray of objectfilter: what must hold for the run to go on. value is a template; op one of exists, not_exists (empty: null, "", [] or {}), equals, not_equals, contains, not_contains (text in any case; a list by its items), gt, gte, lt, lte (numbers, a numeric text too; a list by its length); compare is text or a template, for the operators that compare. When the filter does not pass, its record is filtered with output {passed: false, message: "Stopped: …", skipped: the action steps it skipped}.
matchstringfilter: all (default) of its conditions, or any one.
allanyoverstringloop: a template that gives a list (a text is split at commas and new lines).
maxintegerloop: at most this many items (the rest are left out): any number, each item’s action steps costing credits. Left out: 10, and 5 on Free.
stepsarray of objectloop: its steps.
secondsintegerdelay.
tostringemail: addresses separated by commas; empty: the workflow is saved incomplete until it is filled in. On Free, Starter and Pro, only people in your organization (their sign-in addresses); on Business and Enterprise, anyone. It comes from "<workflow name> via Fous" <workflows@fous.com>, and replies go to the person who made the workflow.
subjectstringemail.
bodyJSON valueemail: the plain-text body (line breaks kept). webhook: the JSON to send, a template or an object of them; left out, the previous step’s output.
urlstringwebhook: a public https address; empty: the workflow is saved incomplete until it is filled in. Each POST carries X-Fous-Workflow, X-Fous-Run, X-Fous-Signature (t=<unix seconds>,v1=<HMAC-SHA256 in hex of "<t>.<body>" with the workflow’s signing_secret>) and an Idempotency-Key that is the same on every attempt of the step (receivers dedupe on it: Fous retries on 5xx, 408, 429 and connection failures, and a run taken up again sends what it recorded under it; one that got no answer in time is not sent again), plus the step’s headers.
headersarray of objectwebhook: headers sent with each POST, for a receiver that needs a key or a token (Authorization, X-API-Key). Their values are write-only secrets: sent as value to set one (empty text clears it), left out to keep the saved one; answers and run records never hold them, only a masked hint (null: no value yet, and the workflow is incomplete until it has one). Not Host, Content-Type, Content-Length, Idempotency-Key, Connection, Transfer-Encoding or X-Fous-*.
secondsintegerdelay.
tostringemail: addresses separated by commas; empty: the workflow is saved incomplete until it is filled in. On Free, Starter and Pro, only people in your organization (their sign-in addresses); on Business and Enterprise, anyone. It comes from "<workflow name> via Fous" <workflows@fous.com>, and replies go to the person who made the workflow.
subjectstringemail.
bodyJSON valueemail: the plain-text body (line breaks kept). webhook: the JSON to send, a template or an object of them; left out, the previous step’s output.
urlstringwebhook: a public https address; empty: the workflow is saved incomplete until it is filled in. Each POST carries X-Fous-Workflow, X-Fous-Run, X-Fous-Signature (t=<unix seconds>,v1=<HMAC-SHA256 in hex of "<t>.<body>" with the workflow’s signing_secret>) and an Idempotency-Key that is the same on every attempt of the step (receivers dedupe on it: Fous retries on 5xx, 408, 429 and connection failures, and a run taken up again sends what it recorded under it; one that got no answer in time is not sent again), plus the step’s headers.
headersarray of objectwebhook: headers sent with each POST, for a receiver that needs a key or a token (Authorization, X-API-Key). Their values are write-only secrets: sent as value to set one (empty text clears it), left out to keep the saved one; answers and run records never hold them, only a masked hint (null: no value yet, and the workflow is incomplete until it has one). Not Host, Content-Type, Content-Length, Idempotency-Key, Connection, Transfer-Encoding or X-Fous-*.
Show child attributesHide child attributes
namestringrequiredvaluestringSent only: the value to save.
hintstring or nullThe saved value masked (its last 4 characters when long), or null.
enabledbooleanpromptstringA change in plain words, for the AI.
messagesarray of objectThe conversation so far, newest last, ending with the person’s.
Show child attributesHide child attributes
rolestringrequireduserassistanttextstringrequired
timezonestringAn IANA time zone. Default UTC.
previewbooleanWith a message to the AI: answer the change without saving it.
Returns
- 200Saved; a change the AI made is the saved workflow with ai (with preview, the workflow as it would be; when the AI only answered, the workflow as it is).
Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_request | The definition (or the body) does not hold: errors lists each problem at its place |
| 402 | insufficient_credits | No credits left, and no extra credits on (or capped, or failing to charge); nothing starts |
| 403 | plan_limit | Schedules and webhooks come with a paid plan (limit.kind api) |
| 404 | not_found | No such workflow |
| 409 | conflict | reason workflow_incomplete: a value is still to fill in (incomplete) or a step’s method still to build (steps), so the workflow cannot run or be turned on |
| 422 | invalid_input | reason ai_failed: the AI’s draft did not hold twice |
| 429 | rate_limited | Too many AI messages this minute (limit.kind chat_per_minute) |
| 503 | service_unavailable | The AI is unavailable: nothing was saved or changed |
Delete a workflow
Deletes the workflow: its schedule and webhook stop, and runs still going are canceled. Its runs stay readable.
Path parameters
idstringrequired
Returns
- 200Deleted.
The answer has these fields:
idstringdeletedboolean
Errors
| Status | Code | When |
|---|---|---|
| 404 | not_found | No such workflow |
Build a pending step’s method
Starts a build of the method a pending step needs, from the step’s build_prompt, as POST /v1/builds starts one (same plan rules and errors). The step’s pending becomes {build_id, status: building}. When the build ends, the step runs the new method with its input and later steps’ references wired by AI, or pending.status is failed with the reason; calling this again retries. Poll GET /v1/workflows/{id} to follow it. site (optional) sets the step’s site and starts the build in one call, saved only when the build starts. A step already building returns its build; sending a different site for it returns 409.
Path parameters
idstringrequiredkeystringrequired
Request body
Optional, JSON.
sitestringOptional: the website to build on, like portal.example.com. Replaces the step’s site when the build starts. Required when the step has none (reason site_required).
connectionsarray of stringOptional: the connected accounts (conn_…) the build may use, as in POST /v1/builds.
Returns
- 202Building.
The answer has these fields:
build_idstringrequiredAlso in GET /v1/builds/{id}.
Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_request | The definition (or the body) does not hold: errors lists each problem at its place |
| 403 | plan_limit | A plan limit (plan_limit): the plan’s sites all have methods (kind sites), or Free’s 3 builds are used (kind builds); or the caller is a reader (forbidden) |
| 404 | not_found | No such workflow, or no step with that key waiting for a method |
| 409 | conflict | reason site_required: no site was sent and the step has none. Or code conflict: the step is already building on a different site |
| 422 | not_buildablerequest_refused | No website, app, account or API is involved (not_buildable), or the request check turned it away (request_refused, with its verdict as reason) |
| 429 | rate_limited | Another build of the organization is running (limit.kind concurrent_builds) |
Remove a step
Removes a step, a pending one included, and what is inside it. Whatever read its output reads nothing: templates are emptied, an emptied required text is left to fill in (incomplete), a filter drops conditions about it, and a transform whose code read it gets new code (a transform with code and no instruction is left as it is and the removal answers 400 naming it: change its code first). Saved like any change: an enabled workflow left with a value to fill in is refused (reason workflow_incomplete).
Path parameters
idstringrequiredkeystringrequired
Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_request | The definition (or the body) does not hold: errors lists each problem at its place |
| 404 | not_found | No such workflow or step |
| 409 | conflict | reason workflow_incomplete: a value is still to fill in (incomplete) or a step’s method still to build (steps), so the workflow cannot run or be turned on |
List a workflow’s runs
The workflow’s runs, newest first, without their steps. Free.
Path parameters
idstringrequired
Query parameters
limitintegerdefault20beforestringThe id of the last run you read (wfr_…), or an ISO time: the page after it. Keep reading while has_more is true.
Returns
- 200The runs.
The answer has these fields:
has_morebooleanrequiredWhether older runs follow.
Errors
| Status | Code | When |
|---|---|---|
| 404 | not_found | No such workflow |
Run a workflow
Starts a run by hand, enabled or not, with input for the trigger’s inputs (defaults filled in, numbers and booleans read from text). With wait (0 to 60 seconds, default 0) the answer is held until the run ends: 200 once it ended, else 202 while it goes on; read it with GET /v1/workflows/{id}/runs/{run_id}. Each method step is a run of its own, in GET /v1/runs too. A run costs 1 credit for each step that runs (methods, AI, transforms, emails and webhooks; steps inside For each once per item). The number shown before you run (cost) is the full run; a run a filter ends early costs less. Triggers, For each, filters and delays are free; failed steps cost nothing. A step whose failure can pass (the site or Fous failing for a moment, a rate limit) is tried again after 20 s, 2 min, 10 min and 30 min, 5 attempts in all; a method step whose method Fous is repairing waits for the repair. A step the organization cannot pay for fails with error.code insufficient_credits, and the run stops there.
Path parameters
idstringrequired
Request body
Optional, JSON.
inputobjectValues for the trigger’s inputs.
waitintegerdefault0
Returns
A WorkflowRun object.
- 200The run ended within wait.
- 202Queued or still going. The same WorkflowRun, with status "queued".
Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_request | The body does not hold, or the input does not fit the trigger’s inputs |
| 404 | not_found | No such workflow |
| 409 | conflict | reason workflow_incomplete: a value is still to fill in (incomplete) or a step’s method still to build (steps), so the workflow cannot run or be turned on |
Get a workflow run
The run with each step as it ran: its status, resolved input, output and error. A step that takes time (a method, a loop, a delay) shows running until it ends. With wait (0 to 60 seconds, default 0) the answer is held until the run ends. Free.
Path parameters
idstringrequiredrun_idstringrequired
Query parameters
waitintegerdefault0Seconds to hold the answer while it is still running, 0 to 60.
Returns
A WorkflowRun object.
- 200The run has ended.
- 202Still going (queued, running or waiting). The same WorkflowRun, with status "running".
Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_request | wait is not a whole number from 0 to 60 |
| 404 | not_found | No such workflow run |
Cancel a workflow run
Cancels a run that is queued, running or waiting: it does not go on, and a method run its step had going is stopped and free. The steps already finished stay charged (credits on the answer).
Path parameters
idstringrequiredrun_idstringrequired
Renew a webhook address
Gives a webhook workflow a new address; the old one stops working at once. A webhook workflow gets its first address when it is saved.
Path parameters
idstringrequired
Returns
- 200The new address.
The answer has these fields:
webhook_urlstringrequired
Renew the signing secret
Gives the workflow a new secret for signing its webhook steps’ calls (X-Fous-Signature); the old one stops signing at once.
Path parameters
idstringrequired
Returns
- 200The new secret.
The answer has these fields:
signing_secretstringrequired
Errors
| Status | Code | When |
|---|---|---|
| 404 | not_found | No such workflow |
Start a run from a webhook
A webhook workflow’s address (webhook_url): another service POSTs JSON here and its fields are the run’s input, checked against the trigger’s inputs. No API key: the address is the secret. The workflow must be enabled. At most 60 calls a minute per workflow, and 100 of its runs waiting to start. With an Idempotency-Key header (or a sender’s delivery id: webhook-id, svix-id, X-GitHub-Delivery, X-Shopify-Webhook-Id), a call that repeats one within 24 hours answers the run the first started (repeated: true) instead of starting another.
No key needed.
Path parameters
tokenstringrequired
Headers
Idempotency-KeystringThe sender’s own id for the call, up to 255 characters. Without it, a sender’s delivery id is used the same way: webhook-id (Standard Webhooks), svix-id, X-GitHub-Delivery or X-Shopify-Webhook-Id.
Request body
Optional, JSON.
Returns
- 202Queued.
The answer has these fields:
run_idstringrequiredworkflow_idstringrequiredrepeatedbooleanThe Idempotency-Key was sent within 24 hours: its run.
Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_request | The body does not fit the trigger’s inputs |
| 403 | plan_limit | Schedules and webhooks come with a paid plan (limit.kind api) |
| 404 | not_found | No workflow at this address |
| 409 | conflict | The workflow is turned off |
| 429 | rate_limited | Too many calls this minute, or 100 runs waiting to start |