Workflow tools
A tool node runs one tool. The inspector of the node shows the name of the tool and a short description. This page gives the full reference for each tool.
The header of a tool node shows the name of the tool. To show a different name on the node, type it in the Title field of the inspector. A title can have 80 characters or fewer. A condition node also has a Title field. Without a title, a condition node shows its rules in short form.
Tools
| Tool | Name in the editor | What it does | Output |
|---|---|---|---|
workflow_noop | Log a message | Records the text in its message argument on the node. | message |
search_leads | Search leads | Finds the leads that match a query in the leads query language, the newest lead first. It finds 20 or fewer. | leads |
get_lead | Get lead | Reads the lead of the visitor whose action started the run. exists is false when the visitor has no lead. | lead and exists |
create_lead | Create lead | Creates a lead for the visitor, and sets the labels in its labels argument on it. | lead, created and labelCount |
upsert_lead | Create or update lead | Updates the lead of the visitor with the responses of the action. If the lead is too old, it creates a lead. | lead, created, updated, changedKeys and labelCount |
set_lead_labels | Set lead labels | Adds labels to the lead in its lead argument, or changes them. | lead and count |
remove_lead_labels | Remove lead labels | Removes labels from the lead in its lead argument. | lead and removed |
set_project_labels | Set project labels | Adds labels to the project of the run, or changes them. | project and count |
remove_project_labels | Remove project labels | Removes labels from the project of the run. | project and removed |
get_project | Get project | Reads the project of the run and its labels. | project |
set_organization_labels | Set organization labels | Adds labels to the organization of the run, or changes them. All the projects of the organization share them. | organization and count |
remove_organization_labels | Remove organization labels | Removes labels from the organization of the run. | organization and removed |
get_organization | Get organization | Reads the organization of the run and its labels. | organization |
set_run_labels | Set run labels | Adds labels to the run, or changes them. | run and count |
remove_run_labels | Remove run labels | Removes labels from the run. | run and removed |
get_run | Get run | Reads the run and its labels. | run |
emit_analytics_event | Emit analytics event | Sends a custom analytics event for the visitor of a lead. | eventId and sent |
http | External API | Sends a request to an external API that the project registered. The registration holds the credential. | status, ok, body, bodyTruncated and durationMs |
action_response | Action response | Sends the payload in its payload argument to the visitor who started the action in its actionId argument. | actionId and recorded |
Create or update lead
Create or update lead (upsert_lead) records the responses of the action that started the
run. A run that an event started records no lead.
| Argument | Required | Value |
|---|---|---|
sameLeadWithin | Yes | A number of seconds from 1 to 31536000. |
prefer | Yes | newer or older. |
labels | No | Labels to set on the lead. The value has the same shape as the labels of Create lead. |
The tool finds the newest lead of the visitor. If the last change to that lead is in the
sameLeadWithin seconds before the action, the tool updates that lead. Otherwise, the tool
creates a lead, the same as Create lead.
An update keeps each key of the lead. It adds each key that only the action has. For a key
that the action and the lead both have, newer keeps the value from the action. older
keeps the value from the lead. If the value in the lead is empty, older also uses the value
from the action.
An empty value from the action does not change the lead. An empty value is null, an empty
list, an empty object or a text with only spaces. false and 0 are
not empty.
| Output | Value |
|---|---|
lead | The lead that the tool created or updated. |
created | true if the tool created a lead. |
updated | true if the tool changed the responses of a lead that existed. |
changedKeys | The response keys with a changed value. After a create, all the response keys. |
labelCount | The number of labels that the tool set. |
The output does not show the response values.
Emit analytics event
Emit analytics event sends a custom analytics event, for example lead_sent. The event
has the Picked ID of the visitor of the lead. It also has the gaid, shopify_client_id and
gclid of the lead, and the workspace version of the lead.
| Argument | Required | Description |
|---|---|---|
type | Yes | The event type. Use 1 to 64 lowercase letters, digits and underscores, and start with a letter. You cannot use an event type that Picked sends, for example lead_created. |
meta | No | An object of values that the event records, for example { "partner": "aia" }. |
lead | No | The lead. If you do not give a lead, the tool uses the lead that started the run. |
The tool uses the scope organization_leads/read.
All the tries of one node visit send the event with the same eventId. When Picked has no
analytics service for the project, or the analytics service does not accept the event, sent
is false and the run continues.
The node fails with one of these codes:
| Code | Retry | Cause |
|---|---|---|
analytics_event_type_invalid | No | The event type does not have the correct format. |
analytics_event_type_reserved | No | Picked sends this event type. |
analytics_meta_invalid | No | meta is not an object. |
analytics_lead_not_found | No | The lead is not in the project. |
analytics_no_visitor | No | The lead has no Picked ID, and an action did not start the run. |
Labels
A row of a label tool can expire. It can set a label only when the owner does not have it. It
can add to a number label. A row of a remove tool can remove a label only when the label
has a given value. For the arguments, the outputs and the scopes of the label tools, refer to
the labels reference.
External APIs
For the arguments of External API and how to register an API, refer to Call an external API from a workflow.
App tools
An app that is installed on the project adds its own tools. Each tool has
the name app.<installation slug>.<tool>, for example app.zoho-crm.create_lead. The
manifest of the app gives the arguments, the output and the effect of each tool. Refer to
Workflow tools in the manifest.
A tool with the effect write is a tool that writes. In a test run, it runs only when
Execute writes is on. Refer to
Execute writes.
To add a tool of an app to a workflow, refer to How to use an app tool in a workflow.
Action responses
For Action response, refer to Wait for an action response.
Failures
When a tool fails, the node fails. An edge on the error exit of the node can continue the run. Refer to the workflow runs reference.
