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

Set up an event-ingest workflow and check batch status

Event ingest is how a system hands Returning.AI a batch of rows and lets a workflow run once for each accepted batch. The API builds and checks the workflow; the batch's own lifecycle is read through the public event ingest status endpoint.
This page combines the two questions that always arrive together: "is my workflow configured for my envelope?" and "did my batch go through?".

The envelope contract#

A sender posts a JSON envelope with three things: the trigger id at the root, the batch id at the root path the trigger is configured for, and an array of rows, each carrying the record id fields the trigger names.
{
  "trigger_id": "<PRODUCTION_TRIGGER_ID>",
  "metadata": { "batch_id": "net-deposit-20260710-001" },
  "data": [
    { "occurred_at": "2026-07-10T12:21:24.001Z", "event_type": "net_deposit.snapshot", "client_id": "<broker-client-id>", "deposit_id": "18774", "net_deposit_delta": 10000 }
  ]
}
That example shows only the event shape a batch carries. It is not a Workflow Builder API request; the batch goes to the event ingest endpoint your account was given, not to the base URL on these pages.

1. Create the workflow with the ingest trigger#

Readback: the trigger's _id and its stored options. The _id is the value the sender posts as trigger_id.
To change the paths later, replace the trigger:

2. Understand the two deduplication layers#

The batch id identifies one submission. The same batch id again is skipped before any row is checked, so an exact retry is always safe and always pays nothing.
A record id identifies one row. A record id seen before is skipped even inside a different batch, and other new rows in that batch still run.
Multiple record id paths are independent checks, not a combined key: a repeat of any one of them makes the row a duplicate, and the path name is not part of the identity. If one business record needs several fields, build one namespaced value before sending it, for example server-2:account-88:trade-100, and configure that single path.
A row with no value at any configured record id path is counted as missing and skipped.

3. Route the rows to the right step, then validate#

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.
The trigger's rows are in data. Map the array, not the envelope, unless a step needs the envelope itself. A workflow that fans out per row belongs in a row-level step; a workflow that needs one aggregate belongs in a bulk step.
Then validate and dry-run with a sample envelope:
Readback: the trace resolves the row from the seeded payload. A literal expression in the trace means the binding is wrong; see the binding playbook.

4. Deploy, then read a batch's status#

After the sender posts a batch, three surfaces answer three different questions:
SurfaceQuestionWhere
Event ingest statusDid the platform receive this batch, and did the workflow run it?GET /v1/data-workflows/event-ingests/status?trigger_id=<triggerId>&batch_id=<batchId>
Bulk update callbackDid the resulting user update finish, and how many rows succeeded?A URL the broker controls, configured on the bulk step
Failure webhookDid a run end in error?The workflow's outgoingWebhookUrl
The status read needs a community API key with the dataWorkflows permission. It is a separate permission from workflowBuilder, and it is the one place dataWorkflows still applies.
Meanings that matter:
pending or queued: accepted, waiting. Minutes of wait are normal for a scheduled dispatch.
processed: the workflow ran. It does not mean every step succeeded, and it does not mean balances changed.
skipped: a duplicate batch id, or every row was a duplicate or had no record id.
failed: rejected before running, for example a batch id missing from the configured path.
orphaned: no deployed workflow matched the trigger.
Read the run's own result with GET /{workflowId}/runs when you need to know whether steps succeeded. processed and a run error can both be true.
Read the newest status before an exact retry: a retry shows as skipped, which hides the original result.

5. Prove the batch end to end#

1.
GET /{workflowId}/runs for the run and GET /runs/{runId} for the step results.
2.
For a bulk step, the bulk update job: status, then per-row details.
3.
The member's own field value.
4.
Your own ledger, to confirm you acknowledged the batch once.
A 2xx from the sender's post proves only that the request was accepted. An ingest row proves it was routed. A run proves it executed. Only the member's value proves the reward.

6. Failure handling#

What you seeWhat it meansWhat to do
Ingest failed with a batch id path messageThe batch id was not at the configured root pathFix the sender, resend under a new batch id.
Ingest skippedDuplicate batch, or all rows duplicatedNothing to do unless the data is genuinely new.
Ingest processed, run errorThe workflow ran and a step failedRead the run detail, fix the step.
Status read 404 right after a 2xx ingestThe batch id could not be read, so the row cannot be found by that idCheck the envelope, then ask for the batch on the Event Ingests board.
Bulk job Failed, every row successThe job failed as a whole and nothing was appliedCheck the CSV header names the community's identifier field, then send a new batch.
No ingest row at allThe request never reached the platformConfirm the exact URL the sender posted to resolves, and ask for the sender's exact request.

7. Cleanup#

Undeploy when the pipeline should stop, then delete. A deleted workflow takes its run history with it, and ingest rows remain readable only through the sender's batch ids for a short window, so keep your own record of what a canary batch proved.

What the API does not cover#

Sending a batch. The sender posts the envelope; there is no Workflow Builder route that submits one.
The bulk job's own status and per-row details, which are separate platform endpoints.
Reading ingest payloads in bulk. The Event Ingests board and its routes are a different surface, and the public status endpoint reads one batch summary.
Triggering a dispatch by hand.
Modified at 2026-10-28 04:43:45
Previous
Edit safely: revisions, conflicts, export, import and copying a workflow
Next
Keep a member's tier or role in sync
Built with