@protobase/cli 0.78.0 → 0.78.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
1
  //#region package.json
2
- var version = "0.78.0";
2
+ var version = "0.78.2";
3
3
  //#endregion
4
4
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@protobase/cli",
3
- "version": "0.78.0",
3
+ "version": "0.78.2",
4
4
  "description": "The protobase command: scaffold, doctor, dev, build and serve a Protobase project.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -43,13 +43,13 @@
43
43
  "dependencies": {
44
44
  "@better-auth/core": "^1.7.12",
45
45
  "@hono/node-server": "^2.1.3",
46
- "@protobase/config": "0.78.0",
47
- "@protobase/layout": "0.78.0",
48
- "@protobase/query": "0.78.0",
49
- "@protobase/schema": "0.78.0",
50
- "@protobase/server": "0.78.0",
51
- "@protobase/ui": "0.78.0",
52
- "@protobase/workflows": "0.78.0",
46
+ "@protobase/config": "0.78.2",
47
+ "@protobase/layout": "0.78.2",
48
+ "@protobase/query": "0.78.2",
49
+ "@protobase/schema": "0.78.2",
50
+ "@protobase/server": "0.78.2",
51
+ "@protobase/ui": "0.78.2",
52
+ "@protobase/workflows": "0.78.2",
53
53
  "@react-email/render": "^2.1.0",
54
54
  "@scalar/hono-api-reference": "^0.12.10",
55
55
  "@sentry/vite-plugin": "^11.10.0",
@@ -6,16 +6,18 @@ Graphs of steps the server runs along their edges, written in a language a model
6
6
 
7
7
  - [Workflows](../reference/workflows.md#turning-them-on) (beta): Workflows kept in the app's database, each changed definition checked and kept as a version, run on the app's own jobs.
8
8
  - [Workflow language](../reference/workflows.md#the-document) (beta): The States Language with JSONata expressions, every value read by name, so a model writes and edits it as a small, local change.
9
- - [Checked on save](../reference/workflows.md#reading-values-by-name) (beta): A definition that does not fit the language, has an edge to no step, reads a value nothing gives or leaves out an argument its step type needs is refused, naming the step and the field. A workflow may start with no steps; such a version is kept, and refused as it is published or run.
9
+ - [Checked on save](../reference/workflows.md#reading-values-by-name) (beta): A definition that does not fit the language, has an edge to no step, reads a value nothing gives or leaves out an argument its step type needs is refused, naming the step and the field.
10
10
  - [Workflow editor](../reference/workflows.md#the-editor) (beta): The admin app draws a workflow as a graph that lays itself out, to add, connect and remove steps of every trigger and step type of the app, its plugins' included, each with a form for its input beside the graph, with every problem the save would refuse shown on its step as it is edited.
11
- - [One page per workflow](../reference/workflows.md#the-workflows-page) (beta): A workflow's full-width page holds its graph, its saved versions to look at read-only, its runs shown on the graph and its trigger, so you build and debug without leaving it; in the sidebar, Workflows lists the workflows.
11
+ - [One page per workflow](../reference/workflows.md#the-workflows-page) (beta): A workflow's focus page is its graph, with Add step, Test run, Runs and Publish beside it in a panel, so you build, test and debug without leaving it; in the sidebar, Workflows lists the workflows.
12
12
  - [Branches, steps per item and retries](../reference/workflows.md#states) (beta): Choices, a step per item with their results merged, waits, and per-step retries, timeouts and error paths.
13
13
  - [HTTP request step](../reference/workflows.md#apphttp) (beta): Calls a URL built at run time through the outgoing-address guard, only at public addresses unless the config allows private ones, reading at most 10 MiB of the answer as JSON, text or a file.
14
14
  - [Records steps](../reference/workflows.md#apprecords) (beta): Create, update, get and list records as the workflow's last editor, with the roles they hold now.
15
15
  - [Mail step](../reference/workflows.md#appmailsend) (beta): Sends mail, with files the run downloaded attached, from the app's own sender.
16
16
  - [Runs and their traces](../reference/workflows.md#traces) (beta): Each run started by hand through the API, from the app's code or by a trigger keeps every step's input, output, logs, timing, tries and error as a JSONL trace in the app's private file storage, whole by the time the run is marked ended, secrets blanked out; every run, only failing ones, or none, set by the app, the workflow or the run.
17
- - [Run debugger](../reference/workflows.md#following-and-debugging-a-run) (beta): Each workflow lists its runs with their status, who started them, when and for how long; a run shown on its workflow's page marks every step's status on the graph of the version it ran on from its trace, live while it runs, with each step's input, output, logs, timing, tries and error, secrets blanked out.
17
+ - [Run debugger](../reference/workflows.md#following-and-debugging-a-run) (beta): Each workflow lists its runs with their status, who started them, when and for how long; a run chosen there marks every step's status on the graph of the version it ran on from its trace, and a run's own address shows it on the latest version, with the way to the one it ran on, live while it runs, with each step's input, output, logs, timing, tries and error, secrets blanked out.
18
18
  - [Run status](../reference/workflows.md#run-status) (beta): The sidebar lists your workflows under Workflows, each marked by how its last 10 ended runs went, red, orange, green or gray, in a shape of its own; a workflow's page says why in words, links to the run, and offers Mark as resolved.
19
+ - [Save, test, then publish](../reference/workflows.md#the-workflows-page) (beta): A save makes a version and changes nothing that is live; publishing puts a saved version live, warning when it has no test run, and puts an older one back.
20
+ - [Use a run's data](../reference/workflows.md#the-workflows-page) (beta): Read each step's input and output beside its form, start a test run from the run's input or any step's output, and insert an earlier step's value into a field from a real run's samples.
19
21
  - [Re-run from a step](../reference/workflows.md#re-running-a-failed-run) (beta): After you fix the workflow, a failed run resumes from its last checkpoint, so no write with a saved checkpoint happens again. If a run kept its trace, you can re-run it from any step it reached, except one inside For each. Earlier steps keep their results. From the chosen step on, anything the steps send goes out again. On the workflow's page, you can start a test run with a sample input.
20
22
  - [Replay a run](../reference/workflows.md#replaying-a-run) (beta): replay a finished run on your workflow as it is now, with the same input. Steps that write are held back and give what the run's trace says they gave, and reads come from the step cache or run again, so you can try a change on the same data without sending anything again.
21
23
  - [Runs that survive restarts](../reference/workflows.md#how-a-run-is-run) (beta): A run takes up where it stood after a restart or a crashed worker from checkpoints that hold only what it needs to go on, never repeating a write whose checkpoint was saved, and every limit fails closed.
@@ -692,7 +692,7 @@ view<typeof workflows>('workflows')
692
692
 
693
693
  ### A record page that opens another
694
694
 
695
- `.recordOpens(to)` sends a record's page to another address in its place, its `{field}`s, in the resource, the key and `run`, filled from the record, replacing the record's address in the history so Back skips it: a workflow run's page opens its workflow's page with the run on the graph. A caller who cannot follow it, such as one who may not read the resource it names, gets the record's own page. The record's own page stays at its address with `?standard=true`.
695
+ `.recordOpens(to)` sends a record's page to another address in its place, its `{field}`s, in the resource, the key and `run`, filled from the record, replacing the record's address in the history so Back skips it: a workflow run's page opens its workflow's page with the run on the graph. A caller who cannot follow it, such as one who may not read the resource it names or open the page it names, gets the record's own page. The record's own page stays at its address with `?standard=true`.
696
696
 
697
697
  ```ts
698
698
  view<typeof workflowRuns>('workflow_runs').recordOpens({ kind: 'record', resource: 'workflows', key: '{workflow_id}', run: '{id}' })
@@ -730,7 +730,7 @@ view<typeof reports>('reports').record({ component: component('ReportStudio'), f
730
730
 
731
731
  The bar gets the record's state, Save, its [actions](#actions-and-views-per-role) behind "...", *Discard changes* while there are any, and a link to the form at `?standard=true`, named after the record, such as *Workflow details*, where the layout's sections and related records stay. A refused save, a conflict and a restored draft show in the notice, a reader who may not change the record gets no Save, and the form shows instead when the surface throws. A caller who may not read the surface's field gets the form. The record's name is in the breadcrumb, with a hidden heading for screen readers. What fills the bar and panels, and how a surface reaches them, is under [Focus pages](custom-components.md#focus-pages). `.record(...)` with `surface` needs a [field type](plugins.md#field-types) that draws the whole area; the built-in `workflow` field is one.
732
732
 
733
- A create address can open a page in place of the form too, for a record made where it is used, as a workflow's test run is made in the workflow's page. `.createOpens(to)` replaces the address, its `{field}`s filled from the address's `values`; an address without them shows the form. A record address's `panel` (`?panel=<name>`) names a panel its surface opens with.
733
+ A create address can open a page in place of the form too, for a record made where it is used, as a workflow's test run is made in the workflow's page. `.createOpens(to)` replaces the address, its `{field}`s filled from the address's `values`; when the address's `values` lack any of those `{field}`s, or the caller may not open the page, the create address shows what the view shows without it: its [`.create(...)`](#create-pages) page when it has one, else the form. A record address's `panel` (`?panel=<name>`) names a panel its surface opens with.
734
734
 
735
735
  ### Read view and edit
736
736
 
@@ -215,28 +215,33 @@ A failing Task or Map fails with an error name: a step type's own, such as `Http
215
215
 
216
216
  ## The editor
217
217
 
218
- A workflow's record page in the admin app, `/workflows/<id>`, and its create form draw the definition as a graph to edit, and save the same document the API saves. In the admin app's sidebar, Workflows is the only entry, with the workflows listed under it by their [run status](#run-status): a workflow's versions, runs, steps and trigger are on its page, and their resources and API stay as they are.
218
+ A workflow's record page in the admin app, `/workflows/<id>`, is a [focus page](ui-config.md#focus-pages): the graph fills the page, and everything you do to it happens beside it. It saves the same document the API saves. A new workflow asks for its name and opens here with no steps and the step picker open. In the admin app's sidebar, Workflows is the only entry, with the workflows listed under it by their [run status](#run-status): a workflow's versions, runs, steps and trigger are on its page, and their resources and API stay as they are.
219
219
 
220
220
  ### The workflow's page
221
221
 
222
222
  :::caution[Beta]
223
- An older version can be looked at, not restored or compared with another, the version selector lists only the latest 100, and the graph has no undo.
223
+ A version can be published or looked at, not compared with another beyond a count of its changes, the version selector lists only the latest 100, the Runs panel the latest 20, and the graph has no undo.
224
224
  :::
225
225
 
226
- A workflow's page is full width, and so is its create form. The graph spans the page, with a side panel beside it on a wide screen and under it on a narrow one; the workflow's name, description and enabled version, its trigger and its runs follow below, and Save stays at the foot of the window. Choosing a step shows its form in the side panel, in view beside the graph.
226
+ The bar under the breadcrumb holds what is live, the version shown, *Add step*, *Runs*, how the work stands, *Test run*, *Save* and *Publish*, with the rest behind "...": *Discard changes*, *Workflow details*, *Turn off* and *Delete*. The graph takes the rest of the page; the wheel pans it, and pinching zooms it. Choosing a step opens its form in the panel beside the graph, and the graph makes room. *Workflow details* leads to the workflow's standard form at `?standard=true`, with its name, description and published version and the Trigger, Runs and Versions tables.
227
227
 
228
- - **Versions.** *Version*, above the graph, chooses which saved version the graph shows, each named with when it was saved, and the latest and the enabled one marked *(latest)* and *(enabled)*; it lists the latest 100. <gap>The version selector cannot offer a version older than the latest 100 because loading more of them into it is not implemented.</gap> Such a version still opens by its address. The latest version is the one you edit. An older one is read-only: no fields to fill in, no *Add a step*, no Save, and no editing on the graph. A bar above the graph, repeated at the top of the side panel, says in words which version is shown and which is the latest, with *Back to the latest*. The version is in the address, `/workflows/<id>?version=<number>`, so a link opens it.
229
- - **Runs.** *Run* chooses one of the workflow's latest 20 runs, each named with when it started, its status and its version, and shows it on the graph, as [Following and debugging a run](#following-and-debugging-a-run) says. A run shows only on the version it ran on: choosing it sets *Version* to that version, choosing another version closes it, and the bar says which version it ran on, with *Close the run*. A run is only read, on the latest version too. The run is in the address, `?version=<number>&run=<id>`, and a run's own address, `/workflow_runs/<id>`, opens the workflow's page with the run on the graph.
230
- - **Test run** starts a run, as [Test runs](#test-runs) says.
228
+ - **Save and Publish.** *Save* makes a new version and changes nothing that is live, so a change can be tried first. *Publish* asks in the panel, says what changes and how many steps differ, warns about a version with no test run, and names the trigger it starts. With unsaved changes it saves them first, and a refused save stops there. *Turn off* stops the workflow; runs in progress stay on their version.
229
+ - **Versions.** *Version* chooses which saved version the graph shows, each marked as the latest and as live; it lists the latest 100. <gap>The version selector cannot offer a version older than the latest 100 because loading more of them into it is not implemented.</gap> Such a version still opens by its address. The latest version is the one you edit. An older one is read-only, with *Edit latest version* in the notice, and publishing it goes back to it. The version is in the address, `/workflows/<id>?version=<number>`, so a link opens it.
230
+ - **Runs.** *Runs* lists the workflow's latest 20 runs in the panel, with status, time, version, how long each took, whether a person or a trigger started it, and its input; each is a link. A run shows as marks on the graph, as [Following and debugging a run](#following-and-debugging-a-run) says. On the latest version the graph stays editable under the marks, so a failure can be read and fixed in one place: a step changed since the run says so. A run of an older version opens from the panel on that version, read-only. The run is in the address, `?run=<id>`, and a run's own address, `/workflow_runs/<id>`, opens the workflow's page with the run on the latest version; for a run of an older version, *Show on version* in the notice shows the version it ran on. *Hide run* takes the marks away.
231
+ - **A step's data.** With a run shown, a chosen step's panel has two tabs, *Data* and *Settings*: its error, output, input, variables and logs in the run, and its form. *Use as test input* starts a test run from the run's input, the first step's input or any step's output, and *Copy JSON* copies it whole.
232
+ - **Re-run from this step** runs again from the chosen step with the run's input, on the version saved last, and keeps the steps before it as they ran, as [Re-running a run](#re-running-a-failed-run) says. With unsaved changes it saves them first. The panel says what stays, and which steps act again. A kept step stays as it ran, so a change to it is not in the re-run: the panel names the first such step and offers to re-run from there. A variable that keeps a step's whole result is the exception: it gets what the kept step gave, so a value inserted from an earlier step works in a re-run from the step that reads it.
233
+ - **Replay without writing**, in the run's panel, runs every step again with the same input, as [Replaying a run](#replaying-a-run) says; steps that write send nothing.
234
+ - **Test run** starts a run in the panel, as [Test runs](#test-runs) says.
235
+ - **Insert value.** Under a step's field, *Insert value* lists the run's input and each earlier step's output from the run shown, or else the latest run that ended among the 20 in *Runs*, with sample values. Choosing one writes the expression into the field, after what it holds. Values are read by name, so an earlier step's output is read through a variable: when that step has none, it gets one, named after the step, and *Undo* takes it back. A step that shapes its result with `Output` is not offered, since a variable keeps its result before `Output`.
231
236
 
232
- A user who may read a workflow but not change it gets the same page, its fields and graph locked.
237
+ A user who may read a workflow but not change it gets the same page, its fields and graph locked, without Save or Publish. On a mobile screen the bar holds what is live, *Runs* and *Test run*, or *Save* with unsaved changes, and the rest behind "..."; a step's form can be changed, and steps are added on a wider screen.
233
238
 
234
- - **The graph lays itself out.** The trigger is on top, each state is a box, a Map is a box around the states it runs for each item, and each edge is drawn from the field that names it: a state's `Next`, a Choice's rules (labelled with their condition) and its `Default` ("Otherwise"), and a Task's or Map's catchers ("On error", dashed). The graph is laid out by ELK's layered algorithm, from top to bottom, each time a state or edge is added, removed or renamed; the document keeps no positions, so the graph a person sees is the one a model or the API wrote, and the one they edit is what a model reads back. The page scrolls under the wheel; the canvas zooms with its buttons and by pinching.
235
- - **Adding a step.** *Add a step* adds a Task of any step type the app can run, its plugins' included, or a Choice, Map, Wait, Pass, Succeed or Fail, named `Step 1`, `Step 2` and so on. It goes into the Map chosen, or the Map the chosen step is in, else into the workflow; it ends the run, or its item, until it is connected, and in a workflow or Map without steps it is the first.
239
+ - **The graph lays itself out.** The trigger is on top, each state is a box, a Map is a box around the states it runs for each item, and each edge is drawn from the field that names it: a state's `Next`, a Choice's rules (labelled with their condition) and its `Default` ("Otherwise"), and a Task's or Map's catchers ("On error", dashed). The graph is laid out by ELK's layered algorithm, from top to bottom, each time a state or edge is added, removed or renamed; the document keeps no positions, so the graph a person sees is the one a model or the API wrote, and the one they edit is what a model reads back. The canvas zooms with its buttons and by pinching.
240
+ - **Adding a step.** *Add step* opens a searchable picker in the panel: every step type the app can run, its plugins' included, each with what it does, then Choice, For each item, Wait, Set values, Succeed and Fail. Search finds other words too, such as *email* for Send mail. It says where the step lands, and choosing a step on the graph changes that. A new step is named `Step 1`, `Step 2` and so on, and goes after the chosen step, taking over where it went on to, or after the last step; into the Map chosen; or first, with the trigger chosen. After a Choice or a step that ends the run it stays unconnected, and so does a Succeed or Fail that would cut off the steps after it, such as one added between two steps or first in a workflow that has steps.
236
241
  - **Connecting steps.** Drag from a step's handle to another step, or tap one handle and then the other: the bottom handle sets `Next`, a Choice's *When* handle adds a rule and its *Otherwise* handle sets `Default`, a Task's or Map's *On error* handle adds a catcher of `States.ALL`, and the trigger's handle sets `StartAt`. A step leads only to steps of its own machine, so an edge into or out of a Map is refused. The chosen step's form sets the same edges with menus: *Goes on to*, each rule's and catcher's *Then goes to*, and *Otherwise goes to*.
237
242
  - **Removing.** Delete or Backspace removes the chosen step or edge, as does the form's *Remove step*. Removing a step removes the edges to it: a `Next` to it becomes `End`, and a rule, `Default` or catcher naming it goes. Removing the first step of a workflow or Map makes the first step left in it the first.
238
243
  - **A step's form.** Choosing a step opens its form in the side panel beside the graph: its name, which renames every edge to it, then what its type takes. A Task's form has a field for each argument of its step type's input schema, the ones it needs marked, as listed under [Step types](#step-types) or by its plugin: one line of text for a string, one line for a number or `true` and `false`, a menu for an `enum`, names separated by commas for a list of strings, and JSON for anything else; a Choice's its rules and `Default`; a Map's `Items` and `MaxConcurrency`; a Wait's `Seconds`; a Pass's and a Succeed's `Output`; a Fail's `Error` and `Cause`. A field takes text, an expression (`{% ... %}`) or JSON; an emptied field is left out. *The step as JSON* edits every field of the step, such as `Retry`, `Assign` and `TimeoutSeconds`. The trigger's form picks among the app's triggers, its plugins' included, and draws a field for each input of its schema the same way, such as a record trigger's resource, `when` and `key`.
239
- - **Problems on their step.** The editor runs the same check as a save on every change, and shows each problem on the step it names, as a count on its box and a list and a marked field in its form; a problem with the trigger or the first step shows on the trigger, and one about the whole document above the graph. Saving writes the definition through the API, where the save hook checks it again: a definition with a problem is refused with the 400 above, whose `errors` hold each problem for the `definition` field, with its state and field in `params`.
244
+ - **Problems on their step.** The editor runs the same check as a save on every change, and shows each problem on the step it names, as a count on its box and a list and a marked field in its form; a problem with the trigger or the first step shows on the trigger, and the bar counts them all, with the list in the panel. A field left to fill in is not a fault yet: a new step shows no red, and the bar says how many fields are left. Save, Test run and Publish then go to the first of them, which says so. Until then the draft stays on this browser, through a reload. Saving writes the definition through the API, where the save hook checks it again: a definition with a problem is refused with the 400 above, whose `errors` hold each problem for the `definition` field, with its state and field in `params`.
240
245
 
241
246
  A save also refuses a Task that leaves out an argument its step type needs, such as `app:http` without `url`, unless its `Arguments` is one expression, whose value is known only when it runs. A user who may read a workflow but not change it sees the same graph and forms, locked. <gap>The editor cannot undo a single change because an undo history is not implemented.</gap> The editor reads the app's types from `GET /api/workflows/types`, `client.workflowTypes()` of `@protobase/client`: the same list `list_workflow_types` gives over MCP, `{ step_types, triggers }`, which only a user who may read workflows gets. A type the app cannot run, such as one that signs in through a connection whose OAuth client the app does not set, is not offered, and the check refuses it with the reason; a stored trigger of such a type, or of a type the app does not have, shows its type and input, read-only. The boxes, their accessible names and a run's step headings name each type by the label the list gives it, such as *Shout* for `acme:shout`.
242
247
 
@@ -338,7 +343,7 @@ A workflow reads a secret only by name, `$states.context.Secrets.TICKETS_TOKEN`,
338
343
 
339
344
  ### Following and debugging a run
340
345
 
341
- A workflow's page in the admin app lists its runs, newest first, with their status, who or what started them, when, how long they took, their version and error. Choosing one, in that list or in *Run* above the graph, shows it on the workflow's page: the graph as the run's version has it, with a mark on each state:
346
+ *Runs* on a workflow's page in the admin app lists its latest 20 runs, newest first, with their status, who or what started them, when, how long they took, their version and input; the Runs table on the workflow's form lists them all, with their error. Choosing one shows it on the workflow's page, on the version it ran on, with a mark on each state. A run's own address opens it on the latest version, as [The workflow's page](#the-workflows-page) says, where *Show on version* shows the version it ran on:
342
347
 
343
348
  | Mark | |
344
349
  | --- | --- |
@@ -346,7 +351,7 @@ A workflow's page in the admin app lists its runs, newest first, with their stat
346
351
  | Retrying | Its last try failed and a retrier tries it again. |
347
352
  | Running | The run is on it, or goes on to it next. |
348
353
 
349
- A state that took more than one step, by its tries, its visits or a Map's items, says how many. Choosing a state lists its steps in the side panel in the order they ran, 20 at a time with *Show more*: each with its try, the Map item it ran in, its status, when it started and how long it took, its error and cause, input, output, the variables it assigned and its logs. Choosing the trigger shows the run's input, and with nothing chosen the side panel shows the run itself: its status, when it started and ended, who started it, its error, input and output. The run's actions, such as *Re-run from the failed step* and *Replay*, stay at the top of the side panel, and *Open the run's own page* leads to the run's record page, `/workflow_runs/<id>?standard=true`, with its re-runs listed, drawn with the `workflow_run` [field type](plugins.md#workflow) on the run's `id`. The page opens on the state that failed, the innermost one when a Map's item failed, so a failed run shows its error and logs at once.
354
+ A state that took more than one step, by its tries, its visits or a Map's items, says how many. Choosing a state lists its steps in the side panel in the order they ran, 20 at a time with *Show more*: each with its try, the Map item it ran in, its status, when it started and how long it took, its error and cause, input, output, the variables it assigned and its logs. Choosing the trigger shows the run's input, and with nothing chosen the side panel shows the run itself: its status, when it started and ended, who started it, its error, input and output. A chosen state's panel offers *Re-run from this step*, and the run's panel *Replay without writing*. *Open the run's own page* leads to the run's record page, `/workflow_runs/<id>?standard=true`, with its re-runs listed, drawn with the `workflow_run` [field type](plugins.md#workflow) on the run's `id`. The page opens on the state that failed, the innermost one when a Map's item failed, so a failed run shows its error and logs at once.
350
355
 
351
356
  The page reads the steps from the run's [trace](#traces), at `/api/workflows/runs/<id>/trace`, for a person who may read the run and its `trace_file`. While a run is queued, running or waiting, the page reads the run again every second, and its trace's steps after those it has, or the whole trace again when those are no longer its first steps, so the marks, the step lists and the run's fields change as it goes, without a reload; it stops once the run has ended. A run that kept no trace says so. Everything the page shows is what the run recorded, so a [secret](#secrets) shows as `[redacted]` wherever it would have been.
352
357
 
@@ -376,13 +381,13 @@ Each workflow has a status from its last 10 ended runs, so you see which ones ne
376
381
  A re-run from a step needs the earlier run's trace, and a re-run from the failed step keeps in its trace only the steps it ran, so it cannot itself be re-run from a state before them.
377
382
  :::
378
383
 
379
- A failed run, shown on its workflow's page, offers *Re-run from the failed step*. A failed run keeps its [checkpoints](#how-a-run-is-run). It opens the form for a new run with `workflow_id` and `rerun_of` filled in; creating it, through the form or `POST /api/v1/workflow_runs` with `{ "workflow_id": "...", "rerun_of": "..." }`, starts a run that:
384
+ A failed run keeps its [checkpoints](#how-a-run-is-run). `POST /api/v1/workflow_runs` with `{ "workflow_id": "...", "rerun_of": "..." }` starts a run that:
380
385
 
381
386
  - runs on the workflow's version now, so fix the step first, and on the earlier run's input: a re-run given an `input` of its own is refused with `rerun-input`;
382
387
  - goes on from the earlier run's checkpoints, as a run goes on after a crash: each scope from its last checkpoint, the state it stood at from its first try, at the re-run's own time. No recorded call before it, such as a mail sent or a record written, happens again; the reads and computing steps since run again. A Map that runs again keeps its finished items and runs again only those that had not finished, each from where it stood;
383
388
  - is refused, and nothing starts, when the earlier run is not one of the workflow's runs the person may read with its trace (404), did not fail (`run-not-failed`), or would go on at a state or in a Map the version no longer has (`rerun-refused`, naming it).
384
389
 
385
- With `rerun_from`, the name of a state of the workflow itself, it re-runs any run that ended, succeeded or failed, from that state: the steps before its first visit stay as they ran, and it and all after it run again, so what they send goes out again. It takes the steps before that state from the earlier run's [trace](#traces), so it needs a run that kept one: a run whose trace is `all`, or `failed` for a run that failed. The re-run goes on from a checkpoint at that state with the variables those steps assigned and the output of the last one, at the re-run's own time, and its own trace starts with those steps, so a re-run of it can start from any earlier state too. A kept step that succeeded, whose state now has a variable that keeps its whole result, `"Assign": { "customer": "{% $states.result %}" }`, gets that variable from what it gave, unless that state shaped its result with `Output` in the version the earlier run ran. A kept step that failed into a catcher keeps what it assigned then. `POST /api/v1/workflow_runs` with `{ "workflow_id": "...", "rerun_of": "...", "rerun_from": "Store" }` does it. It is refused when the run has not ended (`run-not-ended`), kept no trace (`rerun-no-trace`), never reached that state, or the version no longer has it or no longer starts there, or its trace lacks a step before it, as the trace of a re-run from the failed step does (`rerun-refused`), and without `rerun_of` (`rerun-from-without-run`).
390
+ With `rerun_from`, the name of a state of the workflow itself, it re-runs any run that ended, succeeded or failed, from that state: the steps before its first visit stay as they ran, and it and all after it run again, so what they send goes out again. It takes the steps before that state from the earlier run's [trace](#traces), so it needs a run that kept one: a run whose trace is `all`, or `failed` for a run that failed. The re-run goes on from a checkpoint at that state with the variables those steps assigned and the output of the last one, at the re-run's own time, and its own trace starts with those steps, so a re-run of it can start from any earlier state too. A kept step that succeeded, whose state now has a variable that keeps its whole result, `"Assign": { "customer": "{% $states.result %}" }`, gets that variable from what it gave, unless that state shaped its result with `Output` in the version the earlier run ran. A kept step that failed into a catcher keeps what it assigned then. `POST /api/v1/workflow_runs` with `{ "workflow_id": "...", "rerun_of": "...", "rerun_from": "Store" }` does it, and a workflow's page does it from a step with *Re-run from this step*. It is refused when the run has not ended (`run-not-ended`), kept no trace (`rerun-no-trace`), never reached that state, or the version no longer has it or no longer starts there, or its trace lacks a step before it, as the trace of a re-run from the failed step does (`rerun-refused`), and without `rerun_of` (`rerun-from-without-run`).
386
391
 
387
392
  A workflow may be created with no steps: its `definition` then defaults to one with `manual` as its trigger and no states. A save of a definition with no states checks the rest of it as any save does; such a version is kept, and refused as it is published or run.
388
393
 
@@ -394,7 +399,7 @@ A re-run from the failed step's trace holds only the steps it ran itself; the ea
394
399
  A replay holds back only the steps whose type declares that it writes, and a held-back step whose state shaped its result with `Output` in the replayed run gets no result.
395
400
  :::
396
401
 
397
- A run that ended, succeeded or failed, offers *Replay* where it is shown. It opens the form for a new run with `workflow_id`, `rerun_of` and `replay` filled in; creating it, through the form or `POST /api/v1/workflow_runs` with `{ "workflow_id": "...", "rerun_of": "...", "replay": true }`, starts a run from the start on the workflow as it is now and on the replayed run's input, acting as the same people as any run started now. A developer whose workflow sent a mail with the wrong contents fixes the steps that formed it, saves, and replays the run, again until the mail is right, without sending it:
402
+ A run that ended, succeeded or failed, offers *Replay without writing* where it is shown. That, or `POST /api/v1/workflow_runs` with `{ "workflow_id": "...", "rerun_of": "...", "replay": true }`, starts a run from the start on the workflow as it is now and on the replayed run's input, acting as the same people as any run started now. A developer whose workflow sent a mail with the wrong contents fixes the steps that formed it, saves, and replays the run, again until the mail is right, without sending it:
398
403
 
399
404
  - a step whose type writes, such as `app:mail.send`, `app:records.create`, `app:records.update`, an `app:http` request with any method but `GET`, and a plugin's step that does not say it only reads, is not called, and its logs say *Not sent: replay*. It takes the result of the replayed run's step of the same state, in the same Map item, and the same visit of that state, as that run's [trace](#traces) keeps them, so states added or removed elsewhere do not change what it gets; its `Output`, `Assign` and `Next` then apply as the workflow has them now. A step whose visit failed fails with the same error and cause, which only a `Catch` takes, since every retry would give that error again. One the replayed run has no such step for, whose state there was no Task or shaped its result with `Output`, or whose run kept no trace, gives a `null` output and goes on to its next state. <gap>A replay cannot give a held-back step the result of a state that shaped it with `Output` because traces do not record a Task's result before its `Output`.</gap>;
400
405
  - a step that only reads, such as `app:records.get`, `app:records.list`, an `app:http` `GET`, or a plugin's step that says so, is served from the [step cache](workflow-plugins.md#caching-results) when its type caches and an earlier result matches, saying so in its logs, with a line for each secret that changed since that result was kept; otherwise it runs again, as the same people a run of that version acts as;
@@ -404,7 +409,7 @@ A replay given an `input` of its own is refused with `rerun-input`, and one with
404
409
 
405
410
  ### Test runs
406
411
 
407
- A workflow's page offers *Test run*: the form for a new run of the workflow, whose `input` takes a sample input as JSON, which every state reads as `$states.context.Execution.Input`. Creating it opens the workflow's page with the run on the graph, followed as it runs. A test run is a run like any other, of the version saved last, which need not be published: its steps do what they do, acting as that version's saver.
412
+ A workflow's page offers *Test run* in its panel: a sample input as JSON, which every state reads as `$states.context.Execution.Input`, filled in from the last run, with the latest runs' inputs to start from, and what the run will do, naming the steps that act. *Start run* shows the run on the graph, followed as it runs. With unsaved changes it saves them first, as a save changes nothing that is live, and the button says so. A test run is a run like any other, of the version saved last, which need not be published: its steps do what they do, acting as that version's saver.
408
413
 
409
414
  ## Over MCP
410
415