1. Workflow Builder
Returning.AI
  • Getting Started
  • Users
    • User directory and provisioning
    • Get Users with Filters
    • Create New User
    • Get User Data
    • Manage User Account
    • Get User Milestones
    • Update User Data, Identifier, And Roles
    • Update User XP and Currency
  • Messaging
    • Agent messaging workflow
    • Get Messages
    • Send Message
    • Reply Message
    • React Message
    • Upload message images
  • Gamification
    • Leaderboards
      • Leaderboards
      • List leaderboards with pagination
      • Create a new leaderboard
      • Update an existing leaderboard
      • Get a single leaderboard by ID
      • Delete a leaderboard
    • Streaks & Mini Games
      • Mini-game State and History
      • List user streak logs
      • List mini-game logs by user email
      • Get current mini-game and streak state
      • Update user spin-wheel information
    • Referral
      • Referral Program Integration
      • Get referral programs
      • Get user's referral summary
    • Rolling Data
    • Match Predictions
      • Create match prediction
      • List match predictions
      • Get match prediction
      • Patch match prediction
      • Publish match prediction
      • Settle match prediction
      • Get settlement results
      • Void match prediction
      • Bulk update match predictions
      • Get bulk job status
      • Get bulk job results
    • Loyalty Points
      • Create loyalty points export
      • Get loyalty points export status
      • Get loyalty points export download link
    • Get tier configuration
    • Get daily user XP and coin changes
    • Search user gamification logs
    • Get user activity stats
  • Rewards & Redemptions
    • Store catalog to redemptions
    • List redemption orders by custom-field identifier
    • Update redemption order status or refund
    • Create redemption order status
    • List redemption orders by user email
    • List redemption statuses
    • Get redemption status by ID
    • List redemption orders by community
    • Get redemption order status history
  • Chart Analysis
    • Create Analysis
    • Get Analysis
    • Update Analysis
    • Delete Analysis
    • List Analyses
    • Append Drawings
  • Bulk Operations
    • Bulk user updates
    • List bulk update jobs
    • Get bulk update job status
    • Get bulk update job details
    • Bulk update users from CSV
    • Bulk update premium currency from CSV
  • Channels
    • Iframe
    • List integration channels
  • Events
    • Outgoing webhooks
      • Encryption
      • User Joins Server
      • User Visits server
      • New Message Posted Anywhere
      • New Message Posted To channel
      • Purchased Store Item
    • Incoming webhooks
      • API Keys & Encryption
      • Send message into channels
      • Update Custom User Fields
      • Update In-game currency
  • Widgets
    • Authenticated Widgets
    • Public widgets
    • Channels
    • Leaderboard
    • Milestone
    • Socials
    • Store
  • Store
    • Store catalog
    • Purchase History
      • Archive or restore an order
      • Update redemption instructions or voucher details
    • Categories
      • List Store categories
      • Create Store category
      • Get Store category by ID
      • Update Store category
      • Delete Store category
    • Products
      • List products
      • Update products in bulk
      • Create products in bulk
      • Create product with vouchers
      • Read product
      • Update product and append vouchers
      • Delete product
    • Redemption-transaction
      • Get redemption transaction detail
    • Get Store configuration
    • Update Store configuration
  • Community Analytics
    • Get Loyalty Overview
    • Get Phone Verification Contacts
  • Community
    • Community directory and appearance
    • Appearance
      • Update community theme colors
      • Update community bot profile
      • Update community URL metadata
      • Update community name and URL
    • Community Users
      • Get community users
      • Get user
    • Create community
  • API Keys
    • API key lifecycle
    • Community API Keys
      • Create API key
      • Read API keys
      • Delete API key
      • Update API key
    • User API Keys
      • List user API keys
      • Create user API key
      • Update user API key
      • Delete user API key
      • Get current API key information
  • User Fields
    • User field definitions and history
    • User Field History
      • Get all user field histories in a community
      • Get user field histories for a specific field
      • Get user field histories for a specific user
      • Get user field histories of specific user field and user
      • Update A User Field Value
      • Deprecated Field-First History Write
      • Deprecated Field-First History Read
    • Get A User Field Definition
    • Update A User Field Definition
    • Create A User Field Definition
    • Delete A User Field Definition
    • List User Field Definitions
  • Legacy
    • Servers
      • Create server
      • List servers
      • Update server metadata
    • Bulk Operations
      • Bulk import users from CSV
    • Authentication
      • Secure Auth
      • Register user with password
      • Verify user email
      • Log in user with password
    • Badges
      • List badges
      • Create badge
      • Update badge
      • Delete badge
      • Remove badge from user
      • Award badge to user
    • Messaging
    • Roles & Permissions
      • List server roles
      • Create role
      • Update role
      • Delete role
      • List user roles
      • Add role to user
      • Remove role from user
    • Users
      • Get user
      • Upload user avatar
    • Channels
      • Create channel
      • Update channel
      • Delete channel
    • API Keys
      • List integration API keys
      • Create integration API key
      • Delete integration API key
      • Update integration API key
  • Data Workflows
    • Read event-ingest lifecycle status by trigger and batch ID.
  • Community Logs
    • Retrieve and export community logs
  • Workflow Builder
    • Workflow Builder API overview
    • Connect an AI agent to the Workflow Builder tools
    • Bind step inputs to trigger and earlier-step outputs
    • Code steps through the API
    • Edit safely: revisions, conflicts, export, import and copying a workflow
    • Set up an event-ingest workflow and check batch status
    • Keep a member's tier or role in sync
    • Reversible rewards
    • Test without side effects, then confirm a live run
    • Build a trading-rewards workflow from event ingest
    • Reward members from your own system with a webhook workflow
    • List step types and trigger types
      GET
    • List workflows
      GET
    • Create a workflow
      POST
    • Get a workflow
      GET
    • Rename a workflow or set its failure webhook
      PATCH
    • Delete a workflow
      DELETE
    • Duplicate a workflow
      POST
    • Export a workflow definition
      GET
    • Validate a stored workflow
      POST
    • Create or replace the trigger
      PUT
    • Add a step
      POST
    • Get a step
      GET
    • Update a step
      PATCH
    • Delete a step
      DELETE
    • Reorder a main-line step
      POST
    • Duplicate a step
      POST
    • Add a router branch
      POST
    • Update a router branch
      PATCH
    • Delete a router branch
      DELETE
    • Duplicate a router branch
      POST
    • Test one step
      POST
    • Test a whole workflow
      POST
    • Deploy a workflow
      POST
    • Undeploy a workflow
      POST
    • List the runs of a workflow
      GET
    • Get one run
      GET
    • Retry a failed run
      POST
    • Call the workflow tools over MCP
      POST
  • Schemas
    • Sample Schemas
    • Schemas
    • Outgoing webhooks
    • Analysis
    • Pet
    • Category
    • Tag
    • ValidationError
    • NotFoundError
    • InternalServerError
    • NotImplementedError
    • CreateUserFieldHistoryResponse
    • CreateUserFieldHistorySuccessResponse
    • UserFieldHistoryItem
    • GetUserFieldHistoriesResponse
    • UserFieldHistoriesValidationError
    • UserFieldHistoriesMetaWithValidation
    • UserFieldHistoriesMetaWithPagination
    • GetUserFieldHistoriesSuccessResponse
    • CreateUserFieldResponse
    • CreateUserFieldSuccessResponse
    • DeleteUserFieldResponse
    • DeleteUserFieldSuccessResponse
    • UserFieldCreator
    • GetUserFieldResponse
    • GetUserFieldSuccessResponse
    • ValidationErrorItem
    • GetUserFieldsMetaResponse
    • CreatorInfo
    • UserFieldResponse
    • GetUserFieldsSuccessResponse
    • UpdateUserFieldResponse
    • UpdateUserFieldPayload
    • UpdateUserFieldSuccessResponse
    • MetaResponse
    • GetUserResponse
    • GetUserSuccessResponse
    • Purchased store item
    • ErrorResponse
    • New message posted to channel
    • UpdateAnalysisRequest
    • User visits server
    • AppendDrawingsRequest
    • User join server
    • CreateAnalysisResponse
    • GetAnalysisResponse
    • UpdateAnalysisResponse
    • AppendDrawingsResponse
    • AnalysisMetadata
    • Expiry
    • Levels
    • LevelEntry
    • Drawing
    • HorizontalLineDrawing
    • LineDrawing
    • RectangleDrawing
    • ParallelDrawing
    • FibonacciRetracementDrawing
    • Coordinate
    • DrawingStyle
    • AnalysisDetail
    • AnalysisSummary
    • CreateAnalysisRequest
    • ListAnalysesResponse
    • StandardApiError
    • StandardSuccessEnvelope
    • PurchasedStoreItemEvent
    • ChannelMessagePostedEvent
    • UserVisitedCommunityEvent
    • UserJoinedCommunityEvent
  1. Workflow Builder

Test without side effects, then confirm a live run

A workflow that pays members needs two separate answers. First: it does what you think, without paying anyone. Second: it really runs when the trigger fires, and it pays exactly once.
The API separates those two steps with one switch: mode. A dry run writes nothing; mode: "live" is the default, so the deliberate act is choosing the dry run, not the live one. Send mode: "dry-run" for every iteration and keep live for the run you mean.

The three modes, and what each one proves#

ModeWhat it doesWhat it proves
mode: "dry-run"Read-only steps run for real; everything that writes, sends or calls is resolved and reportedThe logic, the branch taken, the resolved member and amounts
mode: "live" test (the default)Every step really runs, like a triggered runThe workflow executes end to end, but leaves no run in the history
Triggered runThe workflow runs because its trigger firedThe whole chain: trigger, workflow, run, side effects

1. Prepare a synthetic member#

Take every field key from the catalog rather than guessing one: GET /catalog returns platformActionFields.get and platformActionFields.post, each entry carrying the key the step stores, the label the platform stores beside it, and whether the field is builtin or custom.
Use a member you created for this purpose, and read their current values through the platform's user endpoints. Record the baseline: field values, history rows, and any job counts you will compare.

2. Dry-run the workflow#

Readback, in this order:
1.
sideEffects: "none".
2.
Every write step is simulated, with wouldDo naming the member, the field, the amount and the logic.
3.
The branch the trace took is the branch you expected.
4.
Any step that is failed names why.
Then prove nothing changed: read the member's value and the workflow's runs again. The counts must be identical to the baseline.

3. Prove the negative case#

Send a second dry run with a payload that must not pay: an ineligible member, a zero volume, a missing identifier.
The trace must take the other branch, or fail the step for the reason you expect. A workflow that pays everybody is not a workflow you have tested.

4. Decide about the live test#

A live test executes for real. It is useful when you need to know the steps run with real data, and it is not a substitute for a real trigger: it leaves no run in the history, so it cannot prove that the trigger is reachable or that the run was recorded.
It needs workflowBuilder like every other call, and nothing else: there is no live-test permission and no confirmation header. The mode is the only thing that makes it live, so send it deliberately:
Readback: sideEffects: "real", a status, the trace, and a historyId for the transient record the call created. Then read the member's value again: the delta must be exactly one reward.
Skip this mode when the workflow pays a live product and a dry run plus a triggered synthetic run already answers the question. The triggered run is the stronger evidence anyway.

5. Deploy and fire the real trigger#

Fire the trigger the way a real sender does, with a fresh event id and a synthetic member. Then read, in order:
1.
GET /{workflowId}/runs: a new run, with a status.
2.
GET /runs/{runId}: per-step results, including the branch taken.
3.
The member's value: exactly one delta.
4.
For a bulk step, the job's per-row detail.
5.
A replay of the same event: no second delta.
Each link is a separate claim. A run success with an unchanged member value is a failure that looks like a success.

6. Something that stays behind#

A dry run writes no history, no step status, no member data and no outbound call. A live test leaves the member's new value: that part is real and must be recorded in your own evidence.

7. Failure handling#

What you seeWhat it meansWhat to do
403 API_KEY_PERMISSION_DENIEDThe key has no workflowBuilder permissionGrant it
A live result where you meant a dry runmode was omitted, and live is the defaultSend mode: "dry-run", and check sideEffects in the response: none means nothing was written
The trace shows a step failed with UNRESOLVED_SIMULATED_REFERENCEThat step reads a step the dry run simulated, and a simulated step produces no output; the workflow status is failTest that step directly with input, or dry-run a workflow whose earlier steps are read-only
Run success, member unchangedThe step was skipped or the amount was zeroRead the run detail and the branch
Two deltas for one eventThe event reached the workflow twiceFix deduplication before the next cycle
Deploy succeeded with warnings you did not readValidation is advisory, so no validation finding refuses a deployRead warnings from the deploy response, and act on each one before the next cycle

8. Cleanup#

Undeploy and delete the test workflow when it exists only for this check. Remove the synthetic member through the platform's user endpoints, or keep it deliberately and say so in your record. Delete any copy of a credential that the run produced in a log or artifact.

What the API does not cover#

Cancelling a payment that a mistaken live run made. That is your reversal process.
Reading the member's own values. Those are platform endpoints.
A trigger that fires a test event from the platform's side. The sender fires it.
A permission that keeps a key from spending money. One permission covers the whole family, so the guard is the mode you pass and the instructions you give the agent or script holding the key.
Confirming that a member-facing screen shows the reward. That is a separate visual check.
Modified at 2026-10-28 04:44:25
Previous
Reversible rewards
Next
Build a trading-rewards workflow from event ingest
Built with