You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After executing a step, the executor posts the outcome back to the server. The body is one of the `StepOutcome` shapes above.
130
129
131
-
> β οΈ **NEVER contains client data** (field values, AI reasoning, etc.) β those stay in the `RunStore` on the client side.
130
+
> **NEVER contains client data** (field values, AI reasoning, etc.) β those stay in the `RunStore` on the client side.
132
131
133
132
---
134
133
135
134
## 3. Pending Data
136
135
137
-
Steps that require user input pause with `status: "awaiting-input"`. The frontend writes `pendingData`to unblock them via a dedicated endpoint on the executor HTTP server.
136
+
Steps that require user input pause with `status: "awaiting-input"`. The executor writes its AI-selected data to `pendingData`in the RunStore. The frontend can then override fields and confirm via the pending-data endpoint.
138
137
139
-
> **TODO** β The pending-data write endpoint is not yet implemented. Route, method, and per-step-type body shapes are TBD (PRD-240).
Once written, the frontend calls `POST /runs/:runId/trigger` and the executor resumes with `userConfirmed: true`.
140
+
The frontend writes user overrides + confirmation to the executor HTTP server. Request bodies are validated per step type with strict Zod schemas β unknown fields are rejected with `400`.
141
+
142
+
Once written, the frontend calls `POST /runs/:runId/trigger`. On the next execution, the executor reads `pendingData` from the RunStore and checks `userConfirmed`:
143
+
-`undefined` β returns `awaiting-input` again (the step is not yet actionable)
144
+
-`true` β execute the confirmed action
145
+
-`false` β skip the step (mark as success)
142
146
143
147
### update-record β user picks a field + value to write
The executor writes the AI's field selection to `pendingData`. The frontend can override `value` and confirm.
146
150
151
+
Stored in RunStore:
147
152
```typescript
148
153
interfaceUpdateRecordPendingData {
149
-
name:string; // technical field name
150
-
displayName:string; // label shown in the UI
151
-
value:string; // value chosen by the user
154
+
name:string; // technical field name (set by executor)
155
+
displayName:string; // label shown in the UI (set by executor)
156
+
value:string; // AI-proposed value; overridable by frontend
157
+
userConfirmed?:boolean; // set by frontend via PATCH
152
158
}
153
159
```
154
160
155
-
### trigger-action β user confirmation only
161
+
PATCH request body:
162
+
```typescript
163
+
{
164
+
userConfirmed: boolean;
165
+
value?:string; // optional override of AI-proposed value
166
+
}
167
+
```
156
168
157
-
No payload required from the frontend. The executor selects the action and writes `pendingData` itself (action name + displayName) to the RunStore. The frontend just confirms:
169
+
### trigger-action & mcp-task β user confirmation only
158
170
159
-
```
160
-
POST /runs/:runId/trigger
171
+
The executor selects the action (or MCP tool) and writes `pendingData` to the RunStore. The frontend cannot override any executor-selected data β it only confirms or rejects.
172
+
173
+
PATCH request body (same for both types):
174
+
```typescript
175
+
{
176
+
userConfirmed: boolean;
177
+
}
161
178
```
162
179
163
180
### load-related-record β user picks the relation and/or the record
164
181
165
-
The frontend can override **both** the relation (field) and the selected record.
166
-
167
-
> **Current status** β The frontend cannot yet override the AI selection. The executor HTTP server does not yet expose the pending-data write endpoint. Until it is implemented, the executor writes the AI's pick directly into `selectedRecordId`.
182
+
The executor writes the AI's relation selection to `pendingData`. The frontend can override the relation, the selected record, or both.
168
183
184
+
Stored in RunStore:
169
185
```typescript
170
-
// Written by the executor; overwritable by the frontend via the pending-data endpoint (TBD)
171
186
interfaceLoadRelatedRecordPendingData {
172
-
name:string; // technical relation name
173
-
displayName:string; // label shown in the UI
174
-
relatedCollectionName:string; //collection of the related record
175
-
suggestedFields?:string[]; //fields suggested for display
176
-
selectedRecordId:Array<string|number>; // AI's pick; overwritten by the frontend via the pending-data endpoint
187
+
name:string; // technical relation name
188
+
displayName:string; // label shown in the UI
189
+
suggestedFields?:string[]; //fields suggested for display (set by executor)
190
+
selectedRecordId:Array<string|number>; //AI's pick; overridable by frontend
191
+
userConfirmed?:boolean;// set by frontend via PATCH
177
192
}
178
193
```
179
194
180
-
The executor initially writes the AI's pick into `selectedRecordId`. The pending-data endpoint overwrites it (and optionally `name`, `displayName`, `relatedCollectionName`) when the user changes the selection.
> `relatedCollectionName` is **not** stored in `pendingData` β the executor re-derives it from the `FieldSchema` at execution time using the (possibly overridden) relation `name`.
187
196
197
+
PATCH request body:
188
198
```typescript
189
199
{
190
-
selectedRecordId?:Array<string|number>; // record chosen by the user
191
-
name?:string; //relation changed
192
-
displayName?:string; // relation changed
193
-
relatedCollectionName?:string; //required if name is provided
200
+
userConfirmed: boolean;
201
+
name?:string; //override relation
202
+
displayName?:string; //override relation label
203
+
selectedRecordId?:Array<string|number>; //override selected record (min 1 element)
194
204
}
195
205
```
196
206
197
-
Response: `204 No Content`.
198
-
199
-
The frontend calls this endpoint **before**`POST /runs/:runId/trigger`. On the next poll, `userConfirmed: true` and the executor reads `selectedRecordId` from the RunStore.
207
+
### Responses
200
208
201
-
### mcp-task β user confirmation only
202
-
203
-
No payload required from the frontend. The executor selects the tool and writes `pendingData` itself (tool name + input) to the RunStore. The frontend just confirms:
204
-
205
-
```
206
-
POST /runs/:runId/trigger
207
-
```
208
-
209
-
The executor resumes with `userConfirmed: true` and executes the pre-selected tool.
209
+
| Status | Meaning |
210
+
|---|---|
211
+
|`204 No Content`| Pending data updated successfully |
212
+
|`400`| Invalid body β type mismatch, unknown fields, or empty `selectedRecordId`|
213
+
|`404`| Step not found, no `pendingData`, or step type does not support confirmation |
210
214
211
215
---
212
216
@@ -222,11 +226,19 @@ Orchestrator βββΊ GET pending?runId=X βββΊ Executor
0 commit comments