Recipe view · 5 Dec 2026
A staged recipe that stops to ask a human between stages: script from demo notes, revise with notes, then LinkedIn post copy from the final transcript. One data table row holds the state.
Generated from the recipe JSON, so this is exactly what runs. IDs and workspace details removed. Code on GitHub →
POST /video-script-v1/video/start→Video script APIVideo script API⇢ asyncVideo script stagePOST /video-script-v1/video/next→Video script next APIVideo script next API⇢ asyncVideo script stagePOST /video-script-v1/video/result→Video script result APIAPI endpoint · POST /video-script-v1/video/start
POST /video/start {context_json, input_text, topic}: new video_runs row, stage script async, 202 {run_id}.
| # | Tag | Step | What it does |
|---|---|---|---|
| 1 | ACTION | Data table: add row video_runs | Create the run row: run_id = this API job id, stage script, status running |
| 2 | ACTION | Call recipe function (async) Video script stage | Start stage script asynchronously |
| 3 | ACTION | Return HTTP response 202 | Accepted: return the run id at once |
API endpoint · POST /video-script-v1/video/next
POST /video/next {run_id, stage: revise|post, input_text}: starts the next stage async, 202.
| # | Tag | Step | What it does |
|---|---|---|---|
| 1 | ACTION | Data table: read rows video_runs | Read the run rows (filter in Python, G05) |
| 2 | FORMULA | Python code | find this run's row and record id |
| 3 | CONTROL | If | Only start a stage for a known run that is not already running |
| 4 | ACTION | Data table: update row video_runs | Mark the run running for this stage |
| 5 | ACTION | Call recipe function (async) Video script stage | Start the stage asynchronously |
| 6 | ACTION | Return HTTP response 202 | Accepted |
| 7 | CONTROL | Else | |
| 8 | ACTION | Return HTTP response 202 | Not started |
API endpoint · POST /video-script-v1/video/result
POST /video/result {run_id}: status needs_input | done | running | failed, plus script, post, questions, checks.
| # | Tag | Step | What it does |
|---|---|---|---|
| 1 | ACTION | Data table: read rows video_runs | Read the run rows (filter in Python, G05) |
| 2 | FORMULA | Python code | this run's row (versions_json = number of script versions) |
| 3 | ACTION | Return HTTP response 200 | Return the run |
Recipe function · called by other recipes
Staged video script (house rule H06): stage script | revise | post. Python builds ONE Model Gateway request per stage from the run row; Python checks (no em-dashes, no trailer lines, only real UI labels, no money on dashboard beats, length vs target, post numbers only from the transcript). Bob asks Alfred between stages.
| # | Tag | Step | What it does |
|---|---|---|---|
| 1 | CONTROL | Monitor (try) | Monitor the stage; on any error mark the run failed and fail the job. |
| 2 | ACTION | Data table: read rows video_runs | read video_runs (the run row holds the context and the current script) |
| 3 | FORMULA | Python code | load the run state and build the ONE gateway request for this stage |
| 4 | AI | HTTP request Model Gateway /v1/chat/completions | one Model Gateway call for this stage (script, revise or post), JSON out |
| 5 | FORMULA | Python code | parse, fix dashes, check UI labels / trailer lines / money / length / numbers, render markdown |
| 6 | CONTROL | If | the answer did not parse or had no beats |
| 7 | ACTION | Data table: update row video_runs | Mark the run failed with the reasons |
| 8 | CONTROL | Stop job (with error) | Fail the job |
| 9 | CONTROL | If | Save: the post stage writes post_text only; script stages write the script and its version history |
| 10 | ACTION | Data table: update row video_runs | Save the post copy on the run row |
| 11 | CONTROL | Else | |
| 12 | ACTION | Data table: update row video_runs | Save the script version on the run row |
| 13 | ACTION | Return result | Return the stage output and what Bob must ask Alfred |
| 14 | CONTROL | On error | |
| 15 | ACTION | Data table: update row video_runs | Mark the run failed |
| 16 | CONTROL | Stop job (with error) | End the job as FAILED after recording the error |