Workflows
startWorkflow on every platform — start one of your outreach workflows for the user your app signed in, with the fields the workflow allows; what it returns, retries and errors. Requires SDK 0.14.4.
Your app can start one of your outreach workflows for the user it signed in — a welcome call after sign-up, a follow-up after an order — with no server of yours. The workflow must have Your app can start this turned on, on its Connect tab (Start from your app).
Requires SDK 0.14.4
iOS, Android, Kotlin Multiplatform and Flutter 0.14.4, React Native 0.47.3 and the website loader 1.5.0.
startWorkflow
Starts a run of the workflow for the identified customer.
| Parameter | Type | Required | Limits | |
|---|---|---|---|---|
workflow | String | Yes | 120 characters | The workflow's exact name, or its id (owf_…) |
data | An object | No | At most 12 values, each text (200 characters), a number or yes/no | The contact fields the workflow allows (its Connect tab). Anything else is left out, never refused — and never a phone number, an email address or another field a step sends to |
idempotencyKey | String | No | 8 to 128 letters, digits, _, -, . or : | Two calls with the same key start one run. Leave it out and the SDK makes one for the call, and uses it again when it retries a request that got no answer |
The run is for the user your app signed in — call identify() with the
agent's identity trait first. Their ID becomes the run's entry.user_id; a
user_id (or reference_id) in data is ignored.
Where the run sends is never your app's to choose. A mobile_number,
email or other field a step sends to is left out of data. A user the agent
knows by phone or email, and verified, is reached at that number or address.
Returns a GraineWorkflowRun:
alreadyRunning is true when the user already had a run of this workflow under
way: you get that run, never a second one.
Resolves when the run has started (or the run already under way was found).
Errors on the device: identity_required when nobody is identified,
invalid_request for a missing workflow name. From Graine:
| Code | Means |
|---|---|
not_allowed | No such workflow, or Your app can start this is off for it, or it isn't published yet |
identity_required | Nobody is signed in with the agent's identity trait |
not_verified | This device isn't one of the user's signed-in devices (Devices per user), or the agent requires a verified user |
identity_unverified | Require verified users is on and this user isn't verified: pass the identity token from your sign-in to identify() |
app_not_allowed | Only my apps is on and this app isn't one of your apps |
app_not_verified | Require a verified app is on and this app hasn't proved it is yours |
rate_limited | Too many starts from this device or for this user (an hour), or of this workflow (a minute) — wait retryAfterSeconds |
unavailable | The workspace can't start it right now: no credit, or the workflow's agent is switched off |
invalid_request | The workflow needs a field your app didn't send (and may not send) |
network | No answer: try again with the same idempotencyKey |
See Errors.

