source.type local) keep their files in a draft you edit, and immutable versions cut from it. Only the active version runs; editing the draft changes nothing until you publish. Repo-backed workflows read their files from the repository instead: these endpoints return 404 for them.
Reads need
workflow.view; writes need workflow.edit.
Files
Every workflow has.bento/workflow/workflow.yml (the steps); request workflows also have .bento/form/form.yml (form syntax). These are required and can’t be deleted. Python dependencies go in requirements.txt.
GET workflows/{id}/files/
?version=<version_id> lists a version’s files instead (read_only: true).
GET workflows/{id}/files/content/?path=.bento/workflow/workflow.yml
?version=.
POST workflows/{id}/files/
{"path": "scripts/create.sh", "content": "#!/bin/bash\n…"} creates a draft file. Paths are relative, without ... 409 if the path exists; 400 for an invalid path, too many files, or too much content.
PUT workflows/{id}/files/content/
{"path": "…", "content": "…"} replaces an existing draft file’s content.
DELETE workflows/{id}/files/content/?path=…
Deletes a draft file. Required files return 400.
Versions
GET workflows/{id}/versions/
POST workflows/{id}/versions/
{"label": "add region"}. Snapshots the draft as the next version and makes it active. 400 if workflow.yml isn’t valid YAML, or a request workflow’s form doesn’t validate.
POST workflows/{id}/versions/{version_id}/activate/
Makes an existing version the one that runs: pin a known-good version or roll back. The draft isn’t changed. Returns {"success": true, "version": {…}}.