picked 0.0.114-next.1 → 0.0.114-next.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.
|
@@ -34,6 +34,22 @@ cannot see it. The node appears as a green rectangle.
|
|
|
34
34
|
An action runs when the flow reaches it. Use an action to record an event, to send
|
|
35
35
|
data, or to start an integration.
|
|
36
36
|
|
|
37
|
+
An action node has two output handles. The center handle connects to the next node. The
|
|
38
|
+
red handle at the bottom right connects to a path for a failure. A connection from the red
|
|
39
|
+
handle is optional.
|
|
40
|
+
|
|
41
|
+
When the red handle has no connection, the flow continues through the center handle after
|
|
42
|
+
a success and after a failure. When the red handle has a connection, a failure goes to its
|
|
43
|
+
path. The center handle then shows a check mark, and a success goes to its path. To use one
|
|
44
|
+
path again, delete the connection from the red handle.
|
|
45
|
+
|
|
46
|
+
An action node that you connect with the Management API or the MCP server can have only a
|
|
47
|
+
success connection. The center handle shows a check mark, and the flow stops on the node after
|
|
48
|
+
a failure.
|
|
49
|
+
|
|
50
|
+
See [Actions](/reference/sdk/actions#outcome-and-branch) for the outcomes that are a
|
|
51
|
+
failure.
|
|
52
|
+
|
|
37
53
|
## Condition
|
|
38
54
|
|
|
39
55
|
A condition node stands for a point where the flow splits. It appears as an amber
|
|
@@ -66,6 +82,7 @@ You can also do this task with the [Management API](/reference/management-api/sc
|
|
|
66
82
|
| Set the layout name of a step | [`stepUpdate`](/reference/management-api/schema/step#stepupdate), [`experienceFlowUpdate`](/reference/management-api/schema/experience#experienceflowupdate) | [`update_experience_flow`](/reference/tools/mcp#update_experience_flow) | `tools.update_experience_flow({ experience_id, workspace_id, update_steps })` |
|
|
67
83
|
| Set the rule of a condition | [`conditionUpdate`](/reference/management-api/schema/condition#conditionupdate), [`experienceFlowUpdate`](/reference/management-api/schema/experience#experienceflowupdate) | [`update_experience_flow`](/reference/tools/mcp#update_experience_flow) | `tools.update_experience_flow({ experience_id, workspace_id, update_conditions })` |
|
|
68
84
|
| Connect two nodes | [`experienceFlowUpdate`](/reference/management-api/schema/experience#experienceflowupdate) | [`update_experience_flow`](/reference/tools/mcp#update_experience_flow) | `tools.update_experience_flow({ experience_id, workspace_id, create_edges })` |
|
|
85
|
+
| Connect the failure path of an action | [`experienceFlowUpdate`](/reference/management-api/schema/experience#experienceflowupdate) | [`update_experience_flow`](/reference/tools/mcp#update_experience_flow) | `tools.update_experience_flow({ experience_id, workspace_id, create_edges })` |
|
|
69
86
|
|
|
70
87
|
## Related
|
|
71
88
|
|
|
@@ -113,6 +113,18 @@ enum ExperienceEdgeHandle {
|
|
|
113
113
|
}
|
|
114
114
|
```
|
|
115
115
|
|
|
116
|
+
### `ActionOutcome`
|
|
117
|
+
|
|
118
|
+
```graphql
|
|
119
|
+
"""The outcome of an action node that an edge leaves by."""
|
|
120
|
+
enum ActionOutcome {
|
|
121
|
+
"""The path the flow takes when the action succeeds."""
|
|
122
|
+
SUCCESS
|
|
123
|
+
"""The path the flow takes when the action fails."""
|
|
124
|
+
FAILURE
|
|
125
|
+
}
|
|
126
|
+
```
|
|
127
|
+
|
|
116
128
|
### `Position`
|
|
117
129
|
|
|
118
130
|
```graphql
|
|
@@ -362,7 +374,9 @@ type ConditionNode implements ExperienceNode {
|
|
|
362
374
|
### `ActionNode`
|
|
363
375
|
|
|
364
376
|
```graphql
|
|
365
|
-
"""
|
|
377
|
+
"""
|
|
378
|
+
A node that starts an action. Its outgoing edges are all plain, or each carries a different `actionOutcome`.
|
|
379
|
+
"""
|
|
366
380
|
type ActionNode implements ExperienceNode {
|
|
367
381
|
"""The ID of the node, unique within the graph."""
|
|
368
382
|
id: ID!
|
|
@@ -410,6 +424,10 @@ type ExperienceEdge {
|
|
|
410
424
|
The branch the edge leaves a condition node from. Null when the source is not a condition node.
|
|
411
425
|
"""
|
|
412
426
|
sourceHandle: ExperienceEdgeHandle
|
|
427
|
+
"""
|
|
428
|
+
The action outcome the edge leaves an action node by. Null on a plain edge or one whose source is not an action node.
|
|
429
|
+
"""
|
|
430
|
+
actionOutcome: ActionOutcome
|
|
413
431
|
}
|
|
414
432
|
```
|
|
415
433
|
|
|
@@ -448,8 +466,14 @@ input ExperienceEdgeInput {
|
|
|
448
466
|
sourceNodeId: ID!
|
|
449
467
|
"""The ID of the node the edge enters."""
|
|
450
468
|
destinationNodeId: ID!
|
|
451
|
-
"""
|
|
469
|
+
"""
|
|
470
|
+
The branch the edge leaves a condition node from. Set only on an edge leaving a condition node.
|
|
471
|
+
"""
|
|
452
472
|
sourceHandle: ExperienceEdgeHandle
|
|
473
|
+
"""
|
|
474
|
+
The action outcome the edge leaves an action node by. Set only on an edge leaving an action node; omit for a plain edge.
|
|
475
|
+
"""
|
|
476
|
+
actionOutcome: ActionOutcome
|
|
453
477
|
}
|
|
454
478
|
```
|
|
455
479
|
|
|
@@ -1032,8 +1056,14 @@ input ExperienceEdgeCreateInput {
|
|
|
1032
1056
|
The `clientId` of a node created in the same call that the edge enters. Excludes `destinationNodeId`.
|
|
1033
1057
|
"""
|
|
1034
1058
|
destinationNodeClientId: ID
|
|
1035
|
-
"""
|
|
1059
|
+
"""
|
|
1060
|
+
The branch the edge leaves a condition node from. Set only on an edge leaving a condition node.
|
|
1061
|
+
"""
|
|
1036
1062
|
sourceHandle: ExperienceEdgeHandle
|
|
1063
|
+
"""
|
|
1064
|
+
The action outcome the edge leaves an action node by. Set only on an edge leaving an action node; omit for a plain edge.
|
|
1065
|
+
"""
|
|
1066
|
+
actionOutcome: ActionOutcome
|
|
1037
1067
|
}
|
|
1038
1068
|
```
|
|
1039
1069
|
|
|
@@ -1050,8 +1080,14 @@ input ExperienceEdgeUpdateInput {
|
|
|
1050
1080
|
sourceNodeId: ID
|
|
1051
1081
|
"""The ID of the node the edge enters."""
|
|
1052
1082
|
destinationNodeId: ID
|
|
1053
|
-
"""
|
|
1083
|
+
"""
|
|
1084
|
+
The branch the edge leaves a condition node from. Set only on an edge leaving a condition node; null keeps the stored branch.
|
|
1085
|
+
"""
|
|
1054
1086
|
sourceHandle: ExperienceEdgeHandle
|
|
1087
|
+
"""
|
|
1088
|
+
The action outcome the edge leaves an action node by. Set only on an edge leaving an action node; null makes it a plain edge.
|
|
1089
|
+
"""
|
|
1090
|
+
actionOutcome: ActionOutcome
|
|
1055
1091
|
}
|
|
1056
1092
|
```
|
|
1057
1093
|
|
|
@@ -27,11 +27,17 @@ workflow. A workflow that has no **Action response** node gives `undefined`.
|
|
|
27
27
|
|
|
28
28
|
| Handler outcome | Branch the flow takes |
|
|
29
29
|
| --- | --- |
|
|
30
|
-
| Throws, or its promise rejects |
|
|
31
|
-
| Resolves to any value, and that includes `false` |
|
|
30
|
+
| Throws, or its promise rejects | The failure connection |
|
|
31
|
+
| Resolves to any value, and that includes `false` | The success connection |
|
|
32
|
+
| No handler has the key of the action | The failure connection |
|
|
33
|
+
|
|
34
|
+
In the flow builder, the failure connection starts at the red handle of the action node. In
|
|
35
|
+
an experience that you make in code, `onFail` makes the failure connection and `onSuccess`
|
|
36
|
+
makes the success connection.
|
|
32
37
|
|
|
33
38
|
An action node can also carry one plain connection, with no success or failure branch. The
|
|
34
|
-
flow then continues through it on either outcome.
|
|
39
|
+
flow then continues through it on either outcome. An action node that has no connection for
|
|
40
|
+
its outcome stops the flow on that node.
|
|
35
41
|
|
|
36
42
|
An action does not interrupt your visitor. The current step stays on the screen while an
|
|
37
43
|
async action runs. While the action runs, the flow ignores a request to go to the next step
|
|
@@ -72,7 +78,7 @@ field. Later steps and conditions read the values from `client.responses`.
|
|
|
72
78
|
The SDK does not write to the fields when:
|
|
73
79
|
|
|
74
80
|
- Your visitor goes back before the action completes.
|
|
75
|
-
- No handler has the key of the action. The flow then takes
|
|
81
|
+
- No handler has the key of the action. The flow then takes the failure connection.
|
|
76
82
|
|
|
77
83
|
## Published actions
|
|
78
84
|
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "picked",
|
|
3
3
|
"description": "The Picked SDK front door: the client, the picked.config helpers, and the picked CLI in one install",
|
|
4
|
-
"version": "0.0.114-next.
|
|
4
|
+
"version": "0.0.114-next.2",
|
|
5
5
|
"bin": {
|
|
6
6
|
"picked": "dist/esm/bin.js"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@picked/cli": "0.0.114-next.
|
|
10
|
-
"@picked/config": "0.0.114-next.
|
|
9
|
+
"@picked/cli": "0.0.114-next.2",
|
|
10
|
+
"@picked/config": "0.0.114-next.2"
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
13
|
"@picked/client": "workspace:*",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"main": "./dist/cjs/index.js",
|
|
65
65
|
"module": "./dist/esm/index.js",
|
|
66
66
|
"peerDependencies": {
|
|
67
|
-
"@picked/client": "0.0.114-next.
|
|
67
|
+
"@picked/client": "0.0.114-next.2"
|
|
68
68
|
},
|
|
69
69
|
"private": false,
|
|
70
70
|
"publishConfig": {
|