@unstable-dev/unmeshed-mcp 0.1.0
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.
- package/README.md +64 -0
- package/dist/auth.d.ts +6 -0
- package/dist/auth.js +11 -0
- package/dist/client.d.ts +46 -0
- package/dist/client.js +97 -0
- package/dist/config.d.ts +10 -0
- package/dist/config.js +31 -0
- package/dist/get-docs.d.ts +8 -0
- package/dist/get-docs.js +64 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +35 -0
- package/dist/server.d.ts +4 -0
- package/dist/server.js +203 -0
- package/knowledge/README.md +16 -0
- package/knowledge/SKILL.md +359 -0
- package/knowledge/assets/patterns.md +637 -0
- package/knowledge/execution/debugging-guide.md +18 -0
- package/knowledge/execution/process-run.schema.md +24 -0
- package/knowledge/execution/step-run.schema.md +21 -0
- package/knowledge/process-definition.schema.md +36 -0
- package/knowledge/references/integrations.md +914 -0
- package/knowledge/references/steps-knowledge.md +834 -0
- package/knowledge/step-definition.schema.md +140 -0
- package/knowledge/step-output-paths.md +45 -0
- package/knowledge/steps/DECISION_ENGINE.md +248 -0
- package/knowledge/steps/DEPENDSON.md +296 -0
- package/knowledge/steps/EXIT.md +220 -0
- package/knowledge/steps/FAIL.md +198 -0
- package/knowledge/steps/FLOW_GATEWAY.md +405 -0
- package/knowledge/steps/FOREACH.md +250 -0
- package/knowledge/steps/HTTP.md +183 -0
- package/knowledge/steps/JAVASCRIPT.md +192 -0
- package/knowledge/steps/JQ.md +189 -0
- package/knowledge/steps/LIST.md +279 -0
- package/knowledge/steps/NOOP.md +165 -0
- package/knowledge/steps/PARALLEL.md +366 -0
- package/knowledge/steps/PYTHON.md +206 -0
- package/knowledge/steps/SEND_RESPONSE.md +301 -0
- package/knowledge/steps/SQLITE.md +301 -0
- package/knowledge/steps/SUB_PROCESS.md +296 -0
- package/knowledge/steps/SWITCH.md +369 -0
- package/knowledge/steps/UPDATE_STEP.md +257 -0
- package/knowledge/steps/WAIT.md +218 -0
- package/knowledge/steps/WHILE.md +328 -0
- package/knowledge/steps/WORKER.md +233 -0
- package/knowledge/system-prompt.md +274 -0
- package/package.json +39 -0
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
# FAIL Step Schema
|
|
2
|
+
|
|
3
|
+
`FAIL` immediately fails the current workflow (or branch) with a given reason.
|
|
4
|
+
It is the counterpart to `EXIT` — while `EXIT` can complete or fail a workflow,
|
|
5
|
+
`FAIL` always produces a `FAILED` status. The step itself and the process both
|
|
6
|
+
end in `FAILED`.
|
|
7
|
+
|
|
8
|
+
Use it for explicit error paths inside SWITCH branches, guard clauses, or
|
|
9
|
+
intentional test failures.
|
|
10
|
+
|
|
11
|
+
## Definition Input Schema
|
|
12
|
+
|
|
13
|
+
```json
|
|
14
|
+
{
|
|
15
|
+
"reason": "Test Failure"
|
|
16
|
+
}
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
| Field | Type | Required | Description |
|
|
20
|
+
|---|---|---|---|
|
|
21
|
+
| `reason` | string | Yes | A human-readable message explaining why the workflow is being failed. Can be an empty string `""`. |
|
|
22
|
+
|
|
23
|
+
## Runtime Output Schema
|
|
24
|
+
|
|
25
|
+
```json
|
|
26
|
+
{
|
|
27
|
+
"reason": "Test Failure"
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
The output mirrors the input — the `reason` string is passed through as the step and process output.
|
|
32
|
+
|
|
33
|
+
## Output Access Paths
|
|
34
|
+
|
|
35
|
+
Use:
|
|
36
|
+
- `steps.<ref>.output.reason` — the failure reason string.
|
|
37
|
+
|
|
38
|
+
Do not use:
|
|
39
|
+
- `steps.<ref>.output.result` — FAIL does not wrap output in `result`.
|
|
40
|
+
- `steps.<ref>.output.response` — FAIL does not have a `response` wrapper.
|
|
41
|
+
- `steps.<ref>.output.error` — the field is `reason`, not `error`.
|
|
42
|
+
|
|
43
|
+
## Process-Level Effect
|
|
44
|
+
|
|
45
|
+
When a FAIL step executes:
|
|
46
|
+
- The step status becomes `FAILED`.
|
|
47
|
+
- The parent container (LIST, PARALLEL branch) propagates the failure upward.
|
|
48
|
+
- The entire process status becomes `FAILED`.
|
|
49
|
+
- The process `output` contains `{ "reason": "..." }`.
|
|
50
|
+
|
|
51
|
+
If the FAIL step is inside a PARALLEL branch with `failIfAnyBranchFails: true`,
|
|
52
|
+
the other branches are cancelled and the PARALLEL step fails.
|
|
53
|
+
|
|
54
|
+
If the FAIL step is inside an `optional: true` parent, the workflow continues
|
|
55
|
+
past the failed section.
|
|
56
|
+
|
|
57
|
+
## Generation Rules
|
|
58
|
+
|
|
59
|
+
- Use uppercase step type: `"FAIL"`.
|
|
60
|
+
- Use `children: []`; FAIL is not a container.
|
|
61
|
+
- `reason` should be a descriptive string; it appears in the process output and logs.
|
|
62
|
+
- Use FAIL inside SWITCH branches to terminate on error conditions.
|
|
63
|
+
- Use FAIL inside PARALLEL branches to intentionally fail one path (e.g. timeout guards).
|
|
64
|
+
- Do not confuse with `EXIT` — EXIT supports both `COMPLETED` and `FAILED` status and has a `message` field. FAIL always fails and uses `reason`.
|
|
65
|
+
- Do not add `script`, `url`, or other fields — FAIL only takes `reason`.
|
|
66
|
+
|
|
67
|
+
## Debugging Rules
|
|
68
|
+
|
|
69
|
+
When debugging a FAIL step:
|
|
70
|
+
- The step will always have `status: "FAILED"` — this is intentional, not an error.
|
|
71
|
+
- Check `output.reason` for the failure message.
|
|
72
|
+
- Trace upward: if the process failed, check whether it was due to a FAIL step by inspecting step records.
|
|
73
|
+
- If used inside a PARALLEL with `failIfAnyBranchFails: true`, sibling branches will be `CANCELLED`.
|
|
74
|
+
|
|
75
|
+
Common failures:
|
|
76
|
+
- Forgetting that FAIL always fails — use `EXIT` with `status: "COMPLETED"` if you want a clean termination.
|
|
77
|
+
- Using FAIL at the top level without `optional: true` on a parent — the entire process will fail.
|
|
78
|
+
- Expecting FAIL output under `error` instead of `reason`.
|
|
79
|
+
|
|
80
|
+
## Minimal Process Definition Example
|
|
81
|
+
|
|
82
|
+
```json
|
|
83
|
+
{
|
|
84
|
+
"orgId": 1,
|
|
85
|
+
"namespace": "default",
|
|
86
|
+
"name": "fail-step",
|
|
87
|
+
"version": 1,
|
|
88
|
+
"type": "API_ORCHESTRATION",
|
|
89
|
+
"description": "Intentionally fail the workflow with a reason.",
|
|
90
|
+
"configuration": null,
|
|
91
|
+
"steps": [
|
|
92
|
+
{
|
|
93
|
+
"orgId": 1,
|
|
94
|
+
"namespace": "default",
|
|
95
|
+
"name": "fail",
|
|
96
|
+
"type": "FAIL",
|
|
97
|
+
"ref": "fail_1",
|
|
98
|
+
"optional": false,
|
|
99
|
+
"createdBy": "system",
|
|
100
|
+
"updatedBy": "system",
|
|
101
|
+
"description": null,
|
|
102
|
+
"label": null,
|
|
103
|
+
"created": 1700000000000,
|
|
104
|
+
"updated": 1700000000000,
|
|
105
|
+
"configuration": {
|
|
106
|
+
"errorPolicyName": null,
|
|
107
|
+
"useCache": false,
|
|
108
|
+
"cacheKey": null,
|
|
109
|
+
"cacheTimeoutSeconds": 0,
|
|
110
|
+
"stream": false,
|
|
111
|
+
"streamAllStatuses": false,
|
|
112
|
+
"preExecutionScript": null,
|
|
113
|
+
"constructInputFromScript": false,
|
|
114
|
+
"scriptLanguage": null,
|
|
115
|
+
"jqTransformer": null,
|
|
116
|
+
"rateLimitMaxRequests": 0,
|
|
117
|
+
"rateLimitWindowSeconds": 0
|
|
118
|
+
},
|
|
119
|
+
"children": [],
|
|
120
|
+
"input": {
|
|
121
|
+
"reason": "Test Failure"
|
|
122
|
+
},
|
|
123
|
+
"output": null
|
|
124
|
+
}
|
|
125
|
+
],
|
|
126
|
+
"defaultInput": null,
|
|
127
|
+
"defaultOutput": null,
|
|
128
|
+
"outputMapping": null,
|
|
129
|
+
"signature": null,
|
|
130
|
+
"metadata": null,
|
|
131
|
+
"tags": null,
|
|
132
|
+
"dependencies": null,
|
|
133
|
+
"dependents": null
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## Minimal Executed Step Example
|
|
138
|
+
|
|
139
|
+
```json
|
|
140
|
+
{
|
|
141
|
+
"id": 593087238,
|
|
142
|
+
"processId": 593087236,
|
|
143
|
+
"ref": "fail_1",
|
|
144
|
+
"namespace": "default",
|
|
145
|
+
"name": "fail",
|
|
146
|
+
"type": "FAIL",
|
|
147
|
+
"status": "FAILED",
|
|
148
|
+
"input": {
|
|
149
|
+
"reason": "Test Failure",
|
|
150
|
+
"__currentExecutionStartTime": 1778222312325
|
|
151
|
+
},
|
|
152
|
+
"output": {
|
|
153
|
+
"reason": "Test Failure"
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## Example: FAIL Inside a SWITCH Branch
|
|
159
|
+
|
|
160
|
+
```json
|
|
161
|
+
{
|
|
162
|
+
"type": "SWITCH",
|
|
163
|
+
"ref": "guard_check",
|
|
164
|
+
"children": [
|
|
165
|
+
{
|
|
166
|
+
"type": "LIST",
|
|
167
|
+
"ref": "happy_path",
|
|
168
|
+
"children": [
|
|
169
|
+
{ "type": "HTTP", "ref": "do_work", "..." : "..." }
|
|
170
|
+
],
|
|
171
|
+
"input": {}
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"type": "FAIL",
|
|
175
|
+
"ref": "error_path",
|
|
176
|
+
"input": { "reason": "Validation failed — missing required fields" },
|
|
177
|
+
"children": [],
|
|
178
|
+
"..." : "..."
|
|
179
|
+
}
|
|
180
|
+
],
|
|
181
|
+
"input": {
|
|
182
|
+
"script": "(steps, context) => {\n if (context.input.isValid) return 'ok';\n return 'fail';\n}",
|
|
183
|
+
"responseMapping": [
|
|
184
|
+
{ "targetRef": "happy_path", "value": "ok" },
|
|
185
|
+
{ "targetRef": "error_path", "value": "fail" }
|
|
186
|
+
]
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
## Comparison: FAIL vs EXIT
|
|
192
|
+
|
|
193
|
+
| | FAIL | EXIT |
|
|
194
|
+
|---|---|---|
|
|
195
|
+
| Step type | `"FAIL"` | `"EXIT"` |
|
|
196
|
+
| Always fails? | Yes | No — supports `COMPLETED` or `FAILED` |
|
|
197
|
+
| Input field | `reason` | `message` + `status` |
|
|
198
|
+
| Use case | Error branches, guard failures, intentional test failures | Clean termination, early exit with success |
|
|
@@ -0,0 +1,405 @@
|
|
|
1
|
+
# Flow Gateway Step Schema
|
|
2
|
+
|
|
3
|
+
`FLOW_GATEWAY` is a script-driven control-flow step that changes which child
|
|
4
|
+
step a parent `LIST` should run next. Use it when you want a `LIST` to behave
|
|
5
|
+
like a jump table, loop, or branch controller based on runtime data.
|
|
6
|
+
|
|
7
|
+
Unlike `SWITCH`, `FLOW_GATEWAY` does not directly run one of its own child
|
|
8
|
+
branches. Instead, it updates the parent `LIST` control-flow pointer so the
|
|
9
|
+
list continues from a specific child `ref`.
|
|
10
|
+
|
|
11
|
+
From the engine source:
|
|
12
|
+
- The step runs a JavaScript `input.script`.
|
|
13
|
+
- The script result is converted to a string and stored in `output.result`.
|
|
14
|
+
- That string is matched against `input.responseMapping`.
|
|
15
|
+
- The first matching `targetRef` is written into the parent LIST's
|
|
16
|
+
`__currentStepRef`.
|
|
17
|
+
- The parent step **must** be a `LIST`.
|
|
18
|
+
- The parent LIST must be operating in control-flow mode for this step to make
|
|
19
|
+
practical sense.
|
|
20
|
+
- The engine tracks control-flow iterations using `__ctfIteration` and
|
|
21
|
+
`__ctfTickets`.
|
|
22
|
+
|
|
23
|
+
Important:
|
|
24
|
+
- `FLOW_GATEWAY` is for internal branching/jumping within a parent `LIST`.
|
|
25
|
+
- It can jump forward or backward to another child ref, so it can create
|
|
26
|
+
loop-like behavior.
|
|
27
|
+
- It should normally be used inside a `LIST` with `input.controlFlow = true`.
|
|
28
|
+
- Branches often end with `EXIT` to avoid unintentionally continuing into later
|
|
29
|
+
sibling steps.
|
|
30
|
+
|
|
31
|
+
## Definition Input Schema
|
|
32
|
+
|
|
33
|
+
```json
|
|
34
|
+
{
|
|
35
|
+
"script": "// (steps, context) will be provided as default inputs \n(steps, context) => {\n return steps.decision_js_1.output.result.nextRoute;\n}",
|
|
36
|
+
"responseMapping": [
|
|
37
|
+
{
|
|
38
|
+
"targetRef": "http_1",
|
|
39
|
+
"value": "retry_http"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"targetRef": "done_exit_1",
|
|
43
|
+
"value": "finish"
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"limitRuns": 10
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
| Field | Type | Required | Description |
|
|
51
|
+
|---|---|---|---|
|
|
52
|
+
| `script` | string | Yes | JavaScript that returns the case/control-flow result. |
|
|
53
|
+
| `responseMapping` | array | Yes | List of case mappings from returned value to target child `ref`. |
|
|
54
|
+
| `limitRuns` | number | No | Observed on the input model with default `10`, but see source note below. |
|
|
55
|
+
|
|
56
|
+
### Response Mapping Shape
|
|
57
|
+
|
|
58
|
+
Each `responseMapping` entry uses this structure:
|
|
59
|
+
|
|
60
|
+
```json
|
|
61
|
+
{
|
|
62
|
+
"targetRef": "done_exit_1",
|
|
63
|
+
"value": "finish",
|
|
64
|
+
"defaultBranch": false
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Fields:
|
|
69
|
+
- `targetRef`: child step ref inside the same parent `LIST`.
|
|
70
|
+
- `value`: script result to match exactly after string conversion.
|
|
71
|
+
- `defaultBranch`: optional fallback branch when no explicit `value` matches.
|
|
72
|
+
|
|
73
|
+
## Runtime Output Schema
|
|
74
|
+
|
|
75
|
+
The flow gateway stores the selected case string and logs in its own step
|
|
76
|
+
output:
|
|
77
|
+
|
|
78
|
+
```json
|
|
79
|
+
{
|
|
80
|
+
"result": "finish",
|
|
81
|
+
"logs": []
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
But the real control-flow effect is on the parent `LIST` input, where the
|
|
86
|
+
gateway updates:
|
|
87
|
+
- `__currentStepRef`
|
|
88
|
+
- `__ctfIteration`
|
|
89
|
+
- `__ctfTickets`
|
|
90
|
+
|
|
91
|
+
Those fields are implementation details, not something later steps should read
|
|
92
|
+
directly in normal workflow design.
|
|
93
|
+
|
|
94
|
+
## Output Access Paths
|
|
95
|
+
|
|
96
|
+
Use:
|
|
97
|
+
- `steps.<ref>.output.result` for the script result string chosen by the
|
|
98
|
+
gateway.
|
|
99
|
+
- `steps.<ref>.output.logs` for captured script logs.
|
|
100
|
+
|
|
101
|
+
Do not use:
|
|
102
|
+
- `steps.<ref>.output.response`
|
|
103
|
+
- `steps.<ref>.output.results`
|
|
104
|
+
- `steps.<ref>.output.<field>` for case strings
|
|
105
|
+
|
|
106
|
+
## Generation Rules
|
|
107
|
+
|
|
108
|
+
- Use uppercase step type: `"FLOW_GATEWAY"`.
|
|
109
|
+
- Use `children: []`; FLOW_GATEWAY is not a container step itself.
|
|
110
|
+
- Place it under a parent `LIST`.
|
|
111
|
+
- Prefer placing it under a parent LIST with `input.controlFlow = true`.
|
|
112
|
+
- The script should return a value that maps cleanly to one `responseMapping`
|
|
113
|
+
case.
|
|
114
|
+
- Map `targetRef` values to sibling child refs inside the same parent LIST.
|
|
115
|
+
- Add a `defaultBranch` mapping when unmatched values are possible.
|
|
116
|
+
- Use `EXIT` at the end of terminal branches when you want to stop the process
|
|
117
|
+
cleanly.
|
|
118
|
+
- If using backward jumps, make sure there is a real exit condition.
|
|
119
|
+
- Put the loop safety limit on the parent LIST as `input.limitRuns`.
|
|
120
|
+
|
|
121
|
+
Observed source nuance:
|
|
122
|
+
- `FlowGatewayInput` defines `limitRuns` with default `10`.
|
|
123
|
+
- But `FlowGatewayRunnerActor` actually reads `limitRuns` from the **parent
|
|
124
|
+
LIST input** with fallback `500`.
|
|
125
|
+
- For predictable behavior, set `limitRuns` on the parent LIST and do not rely
|
|
126
|
+
only on the FLOW_GATEWAY field.
|
|
127
|
+
|
|
128
|
+
## Validation Rules
|
|
129
|
+
|
|
130
|
+
From `FlowGatewayStepValidator`:
|
|
131
|
+
- Duplicate non-default case values are rejected.
|
|
132
|
+
- Templated values are normalized before duplicate checking, so `{{abc}}` and
|
|
133
|
+
`{{ abc }}` count as the same case.
|
|
134
|
+
- A `defaultBranch` entry is ignored in duplicate case checks.
|
|
135
|
+
|
|
136
|
+
## Debugging Rules
|
|
137
|
+
|
|
138
|
+
When debugging a FLOW_GATEWAY:
|
|
139
|
+
- Inspect `input.script`.
|
|
140
|
+
- Inspect `output.result` for the actual case string returned by the script.
|
|
141
|
+
- Inspect `output.logs`.
|
|
142
|
+
- Verify the step has a parent and that the parent type is `LIST`.
|
|
143
|
+
- Verify the parent LIST is configured for control-flow usage.
|
|
144
|
+
- Verify each `responseMapping.targetRef` points to a real child ref in the same
|
|
145
|
+
parent LIST.
|
|
146
|
+
- If it loops unexpectedly, inspect the parent LIST `limitRuns` and the script's
|
|
147
|
+
exit condition.
|
|
148
|
+
- If no mapping matches, check for a missing `defaultBranch`.
|
|
149
|
+
|
|
150
|
+
Common failures:
|
|
151
|
+
- Using FLOW_GATEWAY outside a parent `LIST`.
|
|
152
|
+
- Expecting FLOW_GATEWAY to behave like `SWITCH`.
|
|
153
|
+
- Returning a value not present in `responseMapping`.
|
|
154
|
+
- Forgetting a default branch for unknown values.
|
|
155
|
+
- Creating a backward jump with no exit condition.
|
|
156
|
+
- Putting `limitRuns` only on the gateway input and assuming the runner will use
|
|
157
|
+
it.
|
|
158
|
+
- Looking for branch payloads in `FLOW_GATEWAY` output instead of in the branch
|
|
159
|
+
step outputs.
|
|
160
|
+
|
|
161
|
+
## Minimal Process Definition Example
|
|
162
|
+
|
|
163
|
+
```json
|
|
164
|
+
{
|
|
165
|
+
"orgId": 1,
|
|
166
|
+
"namespace": "default",
|
|
167
|
+
"name": "flow-gateway-example",
|
|
168
|
+
"version": 1,
|
|
169
|
+
"type": "API_ORCHESTRATION",
|
|
170
|
+
"description": "Control-flow list with a flow gateway.",
|
|
171
|
+
"configuration": null,
|
|
172
|
+
"steps": [
|
|
173
|
+
{
|
|
174
|
+
"orgId": 1,
|
|
175
|
+
"namespace": "default",
|
|
176
|
+
"name": "control_flow_list",
|
|
177
|
+
"type": "LIST",
|
|
178
|
+
"ref": "list_1",
|
|
179
|
+
"optional": false,
|
|
180
|
+
"createdBy": "system",
|
|
181
|
+
"updatedBy": "system",
|
|
182
|
+
"description": "Parent LIST operating in control-flow mode.",
|
|
183
|
+
"label": null,
|
|
184
|
+
"created": 1700000000000,
|
|
185
|
+
"updated": 1700000000000,
|
|
186
|
+
"configuration": {
|
|
187
|
+
"errorPolicyName": null,
|
|
188
|
+
"useCache": false,
|
|
189
|
+
"cacheKey": null,
|
|
190
|
+
"cacheTimeoutSeconds": 0,
|
|
191
|
+
"stream": false,
|
|
192
|
+
"streamAllStatuses": false,
|
|
193
|
+
"preExecutionScript": null,
|
|
194
|
+
"constructInputFromScript": false,
|
|
195
|
+
"scriptLanguage": null,
|
|
196
|
+
"jqTransformer": null,
|
|
197
|
+
"rateLimitMaxRequests": 0,
|
|
198
|
+
"rateLimitWindowSeconds": 0
|
|
199
|
+
},
|
|
200
|
+
"children": [
|
|
201
|
+
{
|
|
202
|
+
"orgId": 1,
|
|
203
|
+
"namespace": "default",
|
|
204
|
+
"name": "flow_gateway",
|
|
205
|
+
"type": "FLOW_GATEWAY",
|
|
206
|
+
"ref": "flow_gateway_1",
|
|
207
|
+
"optional": false,
|
|
208
|
+
"createdBy": "system",
|
|
209
|
+
"updatedBy": "system",
|
|
210
|
+
"description": "Choose the next child step to run.",
|
|
211
|
+
"label": null,
|
|
212
|
+
"created": 1700000000000,
|
|
213
|
+
"updated": 1700000000000,
|
|
214
|
+
"configuration": {
|
|
215
|
+
"errorPolicyName": null,
|
|
216
|
+
"useCache": false,
|
|
217
|
+
"cacheKey": null,
|
|
218
|
+
"cacheTimeoutSeconds": 0,
|
|
219
|
+
"stream": false,
|
|
220
|
+
"streamAllStatuses": false,
|
|
221
|
+
"preExecutionScript": null,
|
|
222
|
+
"constructInputFromScript": false,
|
|
223
|
+
"scriptLanguage": null,
|
|
224
|
+
"jqTransformer": null,
|
|
225
|
+
"rateLimitMaxRequests": 0,
|
|
226
|
+
"rateLimitWindowSeconds": 0
|
|
227
|
+
},
|
|
228
|
+
"children": [],
|
|
229
|
+
"input": {
|
|
230
|
+
"script": "// (steps, context) will be provided as default inputs \n(steps, context) => {\n return String(context.input.decision || \"unknown\");\n}",
|
|
231
|
+
"responseMapping": [
|
|
232
|
+
{
|
|
233
|
+
"targetRef": "approved_exit_1",
|
|
234
|
+
"value": "approve"
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
"targetRef": "rejected_exit_1",
|
|
238
|
+
"value": "reject"
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
"targetRef": "unknown_exit_1",
|
|
242
|
+
"defaultBranch": true
|
|
243
|
+
}
|
|
244
|
+
]
|
|
245
|
+
},
|
|
246
|
+
"output": null
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
"orgId": 1,
|
|
250
|
+
"namespace": "default",
|
|
251
|
+
"name": "approved_exit",
|
|
252
|
+
"type": "EXIT",
|
|
253
|
+
"ref": "approved_exit_1",
|
|
254
|
+
"optional": false,
|
|
255
|
+
"createdBy": "system",
|
|
256
|
+
"updatedBy": "system",
|
|
257
|
+
"description": "Approved path.",
|
|
258
|
+
"label": null,
|
|
259
|
+
"created": 1700000000000,
|
|
260
|
+
"updated": 1700000000000,
|
|
261
|
+
"configuration": {
|
|
262
|
+
"errorPolicyName": null,
|
|
263
|
+
"useCache": false,
|
|
264
|
+
"cacheKey": null,
|
|
265
|
+
"cacheTimeoutSeconds": 0,
|
|
266
|
+
"stream": false,
|
|
267
|
+
"streamAllStatuses": false,
|
|
268
|
+
"preExecutionScript": null,
|
|
269
|
+
"constructInputFromScript": false,
|
|
270
|
+
"scriptLanguage": null,
|
|
271
|
+
"jqTransformer": null,
|
|
272
|
+
"rateLimitMaxRequests": 0,
|
|
273
|
+
"rateLimitWindowSeconds": 0
|
|
274
|
+
},
|
|
275
|
+
"children": [],
|
|
276
|
+
"input": {
|
|
277
|
+
"message": "Approved branch completed.",
|
|
278
|
+
"status": "COMPLETED"
|
|
279
|
+
},
|
|
280
|
+
"output": null
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
"orgId": 1,
|
|
284
|
+
"namespace": "default",
|
|
285
|
+
"name": "rejected_exit",
|
|
286
|
+
"type": "EXIT",
|
|
287
|
+
"ref": "rejected_exit_1",
|
|
288
|
+
"optional": false,
|
|
289
|
+
"createdBy": "system",
|
|
290
|
+
"updatedBy": "system",
|
|
291
|
+
"description": "Rejected path.",
|
|
292
|
+
"label": null,
|
|
293
|
+
"created": 1700000000000,
|
|
294
|
+
"updated": 1700000000000,
|
|
295
|
+
"configuration": {
|
|
296
|
+
"errorPolicyName": null,
|
|
297
|
+
"useCache": false,
|
|
298
|
+
"cacheKey": null,
|
|
299
|
+
"cacheTimeoutSeconds": 0,
|
|
300
|
+
"stream": false,
|
|
301
|
+
"streamAllStatuses": false,
|
|
302
|
+
"preExecutionScript": null,
|
|
303
|
+
"constructInputFromScript": false,
|
|
304
|
+
"scriptLanguage": null,
|
|
305
|
+
"jqTransformer": null,
|
|
306
|
+
"rateLimitMaxRequests": 0,
|
|
307
|
+
"rateLimitWindowSeconds": 0
|
|
308
|
+
},
|
|
309
|
+
"children": [],
|
|
310
|
+
"input": {
|
|
311
|
+
"message": "Rejected branch completed.",
|
|
312
|
+
"status": "FAILED"
|
|
313
|
+
},
|
|
314
|
+
"output": null
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
"orgId": 1,
|
|
318
|
+
"namespace": "default",
|
|
319
|
+
"name": "unknown_exit",
|
|
320
|
+
"type": "EXIT",
|
|
321
|
+
"ref": "unknown_exit_1",
|
|
322
|
+
"optional": false,
|
|
323
|
+
"createdBy": "system",
|
|
324
|
+
"updatedBy": "system",
|
|
325
|
+
"description": "Fallback path.",
|
|
326
|
+
"label": null,
|
|
327
|
+
"created": 1700000000000,
|
|
328
|
+
"updated": 1700000000000,
|
|
329
|
+
"configuration": {
|
|
330
|
+
"errorPolicyName": null,
|
|
331
|
+
"useCache": false,
|
|
332
|
+
"cacheKey": null,
|
|
333
|
+
"cacheTimeoutSeconds": 0,
|
|
334
|
+
"stream": false,
|
|
335
|
+
"streamAllStatuses": false,
|
|
336
|
+
"preExecutionScript": null,
|
|
337
|
+
"constructInputFromScript": false,
|
|
338
|
+
"scriptLanguage": null,
|
|
339
|
+
"jqTransformer": null,
|
|
340
|
+
"rateLimitMaxRequests": 0,
|
|
341
|
+
"rateLimitWindowSeconds": 0
|
|
342
|
+
},
|
|
343
|
+
"children": [],
|
|
344
|
+
"input": {
|
|
345
|
+
"message": "Unknown decision value.",
|
|
346
|
+
"status": "FAILED"
|
|
347
|
+
},
|
|
348
|
+
"output": null
|
|
349
|
+
}
|
|
350
|
+
],
|
|
351
|
+
"input": {
|
|
352
|
+
"controlFlow": true,
|
|
353
|
+
"limitRuns": 10
|
|
354
|
+
},
|
|
355
|
+
"output": null
|
|
356
|
+
}
|
|
357
|
+
],
|
|
358
|
+
"defaultInput": {
|
|
359
|
+
"decision": "approve"
|
|
360
|
+
},
|
|
361
|
+
"defaultOutput": null,
|
|
362
|
+
"outputMapping": null,
|
|
363
|
+
"signature": null,
|
|
364
|
+
"metadata": null,
|
|
365
|
+
"tags": null,
|
|
366
|
+
"dependencies": null,
|
|
367
|
+
"dependents": null
|
|
368
|
+
}
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
## Minimal Executed Step Example
|
|
372
|
+
|
|
373
|
+
```json
|
|
374
|
+
{
|
|
375
|
+
"id": 30050099,
|
|
376
|
+
"processId": 30050097,
|
|
377
|
+
"ref": "flow_gateway_1",
|
|
378
|
+
"namespace": "default",
|
|
379
|
+
"name": "flow_gateway",
|
|
380
|
+
"type": "FLOW_GATEWAY",
|
|
381
|
+
"status": "COMPLETED",
|
|
382
|
+
"input": {
|
|
383
|
+
"script": "// (steps, context) will be provided as default inputs \n(steps, context) => {\n return String(context.input.decision || \"unknown\");\n}",
|
|
384
|
+
"responseMapping": [
|
|
385
|
+
{
|
|
386
|
+
"targetRef": "approved_exit_1",
|
|
387
|
+
"value": "approve"
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
"targetRef": "rejected_exit_1",
|
|
391
|
+
"value": "reject"
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
"targetRef": "unknown_exit_1",
|
|
395
|
+
"defaultBranch": true
|
|
396
|
+
}
|
|
397
|
+
],
|
|
398
|
+
"__currentExecutionStartTime": 1778619000000
|
|
399
|
+
},
|
|
400
|
+
"output": {
|
|
401
|
+
"result": "approve",
|
|
402
|
+
"logs": []
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
```
|