Skip to content
LogoLogo

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

ToolName in the editorWhat it doesOutput
workflow_noopLog a messageRecords the text in its message argument on the node.message
search_leadsSearch leadsFinds the leads that match a query in the leads query language, the newest lead first. It finds 20 or fewer.leads
get_leadGet leadReads the lead of the visitor whose action started the run. exists is false when the visitor has no lead.lead and exists
create_leadCreate leadCreates a lead for the visitor, and sets the labels in its labels argument on it.lead, created and labelCount
upsert_leadCreate or update leadUpdates 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_labelsSet lead labelsAdds labels to the lead in its lead argument, or changes them.lead and count
remove_lead_labelsRemove lead labelsRemoves labels from the lead in its lead argument.lead and removed
set_project_labelsSet project labelsAdds labels to the project of the run, or changes them.project and count
remove_project_labelsRemove project labelsRemoves labels from the project of the run.project and removed
get_projectGet projectReads the project of the run and its labels.project
set_organization_labelsSet organization labelsAdds labels to the organization of the run, or changes them. All the projects of the organization share them.organization and count
remove_organization_labelsRemove organization labelsRemoves labels from the organization of the run.organization and removed
get_organizationGet organizationReads the organization of the run and its labels.organization
set_run_labelsSet run labelsAdds labels to the run, or changes them.run and count
remove_run_labelsRemove run labelsRemoves labels from the run.run and removed
get_runGet runReads the run and its labels.run
emit_analytics_eventEmit analytics eventSends a custom analytics event for the visitor of a lead.eventId and sent
httpExternal APISends a request to an external API that the project registered. The registration holds the credential.status, ok, body, bodyTruncated and durationMs
action_responseAction responseSends 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.

ArgumentRequiredValue
sameLeadWithinYesA number of seconds from 1 to 31536000.
preferYesnewer or older.
labelsNoLabels 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.

OutputValue
leadThe lead that the tool created or updated.
createdtrue if the tool created a lead.
updatedtrue if the tool changed the responses of a lead that existed.
changedKeysThe response keys with a changed value. After a create, all the response keys.
labelCountThe 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.

ArgumentRequiredDescription
typeYesThe 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.
metaNoAn object of values that the event records, for example { "partner": "aia" }.
leadNoThe 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:

CodeRetryCause
analytics_event_type_invalidNoThe event type does not have the correct format.
analytics_event_type_reservedNoPicked sends this event type.
analytics_meta_invalidNometa is not an object.
analytics_lead_not_foundNoThe lead is not in the project.
analytics_no_visitorNoThe 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.