picked 0.0.117-next.3 → 0.0.117

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.
@@ -297,7 +297,7 @@ These rules apply to lifecycle events, app events and tool calls.
297
297
 
298
298
  | Rule | Value |
299
299
  | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
300
- | Time to answer | 15 seconds for the full request, resends included. |
300
+ | Time to answer | 30 seconds for a tool call, `installation.created` and `installation.upgraded`. 15 seconds for an app event and `installation.deleted`. The time includes resends. |
301
301
  | Resends | Only for a request with an `idempotency-key` header: app events and tool calls. Picked sends such a request three times at most, after a `408`, a `429`, a `5xx` or no answer. |
302
302
  | Redirects | Picked does not go to a new address that a `3xx` answer gives. A `3xx` answer is not a `2xx` answer. |
303
303
  | Answer body | Picked reads 256 KiB of the answer at most. |
@@ -11,13 +11,13 @@ have a template in a text value of its rule.
11
11
 
12
12
  ## Data that a template reads
13
13
 
14
- | Root | Data | Example |
15
- | ----------------- | ---------------------------------------------------------------------- | -------------------------------- |
16
- | `trigger` | The event or the action that started the run. | `trigger.action.responses.email` |
17
- | `nodes.<node-id>` | The output of the last visit to a tool node. Refer to [Loops](#loops). | `nodes.n2.leads[0].id` |
18
- | `run` | The run. Refer to [Variables](#variables). | `run.startedAt` |
19
- | `workflow` | The workflow. Refer to [Variables](#variables). | `workflow.name` |
20
- | `current` | The node that reads the data. Refer to [Variables](#variables). | `current.visit` |
14
+ | Root | Data | Example |
15
+ | ----------------- | --------------------------------------------------------------------------- | -------------------------------- |
16
+ | `trigger` | The event or the action that started the run. Refer to [Trigger](#trigger). | `trigger.action.responses.email` |
17
+ | `nodes.<node-id>` | The output of the last visit to a tool node. Refer to [Loops](#loops). | `nodes.n2.leads[0].id` |
18
+ | `run` | The run. Refer to [Variables](#variables). | `run.startedAt` |
19
+ | `workflow` | The workflow. Refer to [Variables](#variables). | `workflow.name` |
20
+ | `current` | The node that reads the data. Refer to [Variables](#variables). | `current.visit` |
21
21
 
22
22
  A template writes an index as `[0]`, such as `leads[0].id`. The `var` operator of a rule
23
23
  reads the same paths, and writes an index as a segment, such as `leads.0.id`.
@@ -26,6 +26,43 @@ In the editor, the **Insert reference** button of a field shows the data that th
26
26
  read. The **Previous steps** tab shows `trigger` and `nodes`. The **Variables** tab shows
27
27
  `run`, `workflow` and `current`.
28
28
 
29
+ ## Trigger
30
+
31
+ All runs have these paths below `trigger`: `id`, `name`, `occurredAt`, `projectId`,
32
+ `workspaceId`, `entityId` and `actorId`. The trigger of the workflow adds more paths:
33
+
34
+ | Trigger | Path | Value |
35
+ | ------------------------------ | --------------------------------------- | ----------------------------------------------------- |
36
+ | An action | `trigger.action.actionKey` | The key of the action. |
37
+ | An action | `trigger.action.pickedId` | The Picked ID of the visitor. |
38
+ | An action | `trigger.action.responses.<key>` | The answer to a field that the action has. |
39
+ | An event | `trigger.event.name` | The name of the event, such as `workspace.published`. |
40
+ | `lead.created`, `lead.updated` | `trigger.lead.id` | The ID of the lead. |
41
+ | `lead.created`, `lead.updated` | `trigger.lead.pickedId` | The Picked ID of the visitor. |
42
+ | `lead.created`, `lead.updated` | `trigger.lead.workspaceVersionId` | The workspace version that captured the lead. |
43
+ | `lead.created`, `lead.updated` | `trigger.lead.createdAt` | The time that Picked captured the lead. |
44
+ | `lead.created`, `lead.updated` | `trigger.lead.responses.<key>` | The answer to a field of the workspace. |
45
+ | `lead.created`, `lead.updated` | `trigger.lead.labels.<namespace>.<key>` | The value of a label on the lead. |
46
+
47
+ A lead event also has `trigger.event.name`. `trigger.lead.userId` is the old name of
48
+ `trigger.lead.pickedId`.
49
+
50
+ Picked reads the lead when each node starts. A node reads the labels and the answers that
51
+ the lead has at that time, not the values at the time of the event. A node after a
52
+ **Set lead labels** node reads the labels that it set. In a test run with **Execute writes**
53
+ off, **Set lead labels** does not write. The nodes after it read the old labels.
54
+
55
+ If the lead was deleted, the node fails.
56
+
57
+ A workflow for `lead.created` or `lead.updated` reads leads, so it needs the scope
58
+ `ORGANIZATION_LEADS_READ`. To save the workflow, you must have this scope.
59
+
60
+ To set labels on the lead of the event, set the `lead` argument of a **Set lead labels** node
61
+ to `{{ trigger.lead }}`.
62
+
63
+ In a test run of a workflow for `lead.created` or `lead.updated`, you must give the ID of a
64
+ lead.
65
+
29
66
  ## Variables
30
67
 
31
68
  | Path | Type | Value |
@@ -20,10 +20,11 @@ uses. The page names each scope that you do not have.
20
20
 
21
21
  ## Trigger input
22
22
 
23
- | Trigger | Input | Meaning |
24
- | ------- | ------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
25
- | Action | One input for each action field | The answer to that field. Nodes read it as `trigger.action.responses.<key>`. If a field is empty and not required, the run sends no answer for it. |
26
- | Event | **Entity ID** | The entity that the event is about. Nodes read it as `trigger.entityId`. An empty field uses the workspace. |
23
+ | Trigger | Input | Meaning |
24
+ | -------------------------------------- | ------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
25
+ | Action | One input for each action field | The answer to that field. Nodes read it as `trigger.action.responses.<key>`. If a field is empty and not required, the run sends no answer for it. |
26
+ | Other event | **Entity ID** | The entity that the event is about. Nodes read it as `trigger.entityId`. An empty field uses the workspace. |
27
+ | `lead.created` or `lead.updated` event | **Lead ID** | The ID of the lead that the event is about. Nodes read the lead as `trigger.lead`. This field is required. |
27
28
 
28
29
  Each action field gets the input for its type:
29
30
 
@@ -205,7 +205,7 @@ An operation with `@auth` needs a caller that has authenticated. `@auth(only: US
205
205
  | [`workbenchAssetImport`](/reference/management-api/schema/workbench#workbenchassetimport) | Mutation | Imports an asset owned elsewhere into a workbench as `IMPORTED`. The asset's owner does not change. Scope: `ORGANIZATION_WORKSPACE_UPDATE`. |
206
206
  | [`workbenchAssetRemove`](/reference/management-api/schema/workbench#workbenchassetremove) | Mutation | Removes an asset from a workbench. Removing an `OWNED` asset also deletes it, which needs `ORGANIZATION_PROJECTS_UPDATE` and fails once a publish uses the asset. Scope: `ORGANIZATION_WORKSPACE_UPDATE`. |
207
207
  | [`workflow`](/reference/management-api/schema/workflow#workflow) | Query | Reads a workflow. Scope: `ORGANIZATION_WORKSPACE_READ`. |
208
- | [`workflowCreate`](/reference/management-api/schema/workflow#workflowcreate) | Mutation | Creates a workflow in a workspace. The caller must hold the scopes the tools of the graph need, as `Workflow.scopes` describes. Scope: `ORGANIZATION_WORKSPACE_UPDATE`. |
208
+ | [`workflowCreate`](/reference/management-api/schema/workflow#workflowcreate) | Mutation | Creates a workflow in a workspace. The caller must hold the scopes the workflow needs, as `Workflow.scopes` describes. Scope: `ORGANIZATION_WORKSPACE_UPDATE`. |
209
209
  | [`workflowDelete`](/reference/management-api/schema/workflow#workflowdelete) | Mutation | Deletes a workflow. Published versions keep their copy, and an action that started it can start another workflow. Scope: `ORGANIZATION_WORKSPACE_UPDATE`. |
210
210
  | [`workflowGraphUpdate`](/reference/management-api/schema/workflow#workflowgraphupdate) | Mutation | Updates the graph of a workflow with a change set, all or nothing. A refused change set writes nothing and comes back in `errors`. Scope: `ORGANIZATION_WORKSPACE_UPDATE`. |
211
211
  | [`workflowRun`](/reference/management-api/schema/workflow-run#workflowrun) | Query | Reads a workflow run. Scope: `ORGANIZATION_WORKSPACE_READ`. |
@@ -45,8 +45,8 @@ workflows(first: Int, after: String, last: Int, before: String, workspaceId: ID!
45
45
 
46
46
  ### `workflowCreate`
47
47
 
48
- Creates a workflow in a workspace. The caller must hold the scopes the tools of the graph need,
49
- as `Workflow.scopes` describes.
48
+ Creates a workflow in a workspace. The caller must hold the scopes the workflow needs, as
49
+ `Workflow.scopes` describes.
50
50
  Scope: `ORGANIZATION_WORKSPACE_UPDATE`.
51
51
 
52
52
  ```graphql
@@ -110,8 +110,9 @@ type Workflow {
110
110
  """What starts a run. Set at creation and fixed after."""
111
111
  trigger: WorkflowTrigger!
112
112
  """
113
- The scopes a run acts with, set by the tools the graph names each time the graph is saved.
114
- Saving needs each of them except `ORGANIZATION_LEADS_CREATE`, `ORGANIZATION_ACTION_RUNS_READ`,
113
+ The scopes a run acts with: those the tools the graph names declare, and
114
+ `ORGANIZATION_LEADS_READ` for a `LEAD_CREATED` or `LEAD_UPDATED` trigger, which reads its lead.
115
+ They are set when the workflow is created, imported or its graph is saved. Saving needs each of them except `ORGANIZATION_LEADS_CREATE`, `ORGANIZATION_ACTION_RUNS_READ`,
115
116
  `ORGANIZATION_ACTION_RUNS_UPDATE` and `ORGANIZATION_EXTERNAL_APIS_CALL`, which any author grants.
116
117
  """
117
118
  scopes: [Scope!]!
@@ -617,7 +618,9 @@ tool with its shapes resolved against the fields of the workspace, and the run v
617
618
  """
618
619
  type WorkflowReferences {
619
620
  """
620
- The paths beneath `trigger`: `action` and its responses for an `ACTION` trigger, `event` for an `EVENT` trigger.
621
+ The paths beneath `trigger`: `action` and its responses for an `ACTION` trigger, `event` for an
622
+ `EVENT` trigger, and `lead` with its responses and labels beside `event` for a `LEAD_CREATED` or
623
+ `LEAD_UPDATED` trigger.
621
624
  """
622
625
  trigger: [WorkflowReferenceEntry!]!
623
626
  """The paths beneath `nodes.<id>`, by the tool the node runs."""
@@ -952,7 +955,8 @@ input WorkflowTestRunInput {
952
955
  responses: JSON
953
956
  """
954
957
  The ID of the entity the event is about, for an `EVENT` trigger, read as `trigger.entityId`.
955
- Defaults to the ID of the workspace.
958
+ For `lead.created` and `lead.updated` it is the lead, read as `trigger.lead`. Defaults to the ID
959
+ of the workspace.
956
960
  """
957
961
  entityId: ID
958
962
  """
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.117-next.3",
4
+ "version": "0.0.117",
5
5
  "bin": {
6
6
  "picked": "dist/esm/bin.js"
7
7
  },
8
8
  "dependencies": {
9
- "@picked/cli": "0.0.117-next.3",
10
- "@picked/config": "0.0.117-next.3"
9
+ "@picked/cli": "0.0.117",
10
+ "@picked/config": "0.0.117"
11
11
  },
12
12
  "devDependencies": {
13
13
  "@picked/client": "workspace:*",
@@ -74,7 +74,7 @@
74
74
  "main": "./dist/cjs/index.js",
75
75
  "module": "./dist/esm/index.js",
76
76
  "peerDependencies": {
77
- "@picked/client": "0.0.117-next.3"
77
+ "@picked/client": "0.0.117"
78
78
  },
79
79
  "private": false,
80
80
  "publishConfig": {