Scrub API
POST/v1/tools/save_flowfree

Save a flow

Saves a flow, free: its title, its definition as open_flow gives it (inputs, params and steps; at most 20 steps), and where its steps sit. A step may be one of Scrub's tools ({id, tool, inputs, params, pass, params_from}): it runs as that tool is when the flow runs, its settings fixed by params, given each run by pass, read from an earlier step's result by params_from (its material only: the slides Plan the slides makes, for Make an explainer video, which then makes no pictures, its places keeping their icons, since how many is known only once the slides are made; pictures are one press away on its page from the result), or the tool's own. It is checked as a tool is: every step's inputs from the flow's inputs or an earlier step's result, every step priced by what is given before anything runs; one that would not run is not saved, and says why. A new flow is given its name (flow_…) and runs by that name, as any tool does, priced before it runs; its title changes freely. Saving one by its name keeps a new version; given version, it is saved only if that is still its latest.

Fields

FieldTypeDefaultWhat it is
flowstringNoneIts name, flow_…, to save a new version
titlestringRequiredWhat it is called
definitionobjectRequiredIts inputs, params and steps, as open_flow gives them; its title, version, category and icon are filled in from its title and first step when left out.
layoutobjectNoneWhere its steps sit on the canvas
versionintegerNoneThe version it was opened at

Call it

Request

curl -X POST https://app.scrub.app/v1/tools/save_flow \
  -H "Authorization: Bearer $SCRUB_KEY" \
  -H "Content-Type: application/json" \
  -d '{"title":"…","definition":{}}'

Answer

{
  "ok": true,
  "result": {
    "…": "…"
  }
}

What result holds is said above.

Every call can also answer an error: what comes back. Try it with your key from Account.