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

Retry a failed run

POST
/v1/workflow-builder/data-workflows/runs/{runId}/retry
POST /runs/{runId}/retry needs workflowBuilder.

What this endpoint does#

Queues a failed run of a deployed workflow to execute again. A retry is not a resume: the whole workflow runs from the trigger again, including steps that already succeeded, paid rewards, or called an outside service.
There is no confirmation header and no separate retry permission to hold back a caller who should not retry: workflowBuilder covers it. What protects you is the per-run claim below, which stops two retries of one run from both queueing, and an Idempotency-Key, which turns a lost response into a replay.

Quick start#

Authentication and permission#

Authorization: Bearer <API_KEY> with workflowBuilder, and the run must belong to the key's community.
FailureMeaningRecovery
403 API_KEY_PERMISSION_DENIEDThe key has no workflowBuilder permissionGrant the permission.
404 RUN_NOT_FOUNDUnknown run id, or a run of another communityUse a run id from the list.
409 RETRY_IN_PROGRESSA retry of this run is already claimed, and this call carried no key or a different oneWait for the queued retry to finish, then read the runs list.

Complete examples#

A first call queues the run:
{
  "data": {
    "requested": 1,
    "queued": 1,
    "skipped": [],
    "sideEffects": "real",
    "alreadyRequested": false,
    "reExecution": "The whole workflow runs again from the trigger, including steps that already succeeded, paid rewards or called outside services."
  }
}
A repeat with the same Idempotency-Key replays the recorded answer instead of queueing again:
{
  "data": {
    "requested": 1,
    "queued": 1,
    "skipped": [],
    "sideEffects": "real",
    "alreadyRequested": true,
    "reExecution": "The whole workflow runs again from the trigger, including steps that already succeeded, paid rewards or called outside services."
  }
}
A second call while the first retry is still in progress, with a different key or no key, is refused:
{
  "meta": {
    "status": "error",
    "statusCode": 409,
    "code": "RETRY_IN_PROGRESS",
    "runId": "65f1a2b3c4d5e6f708192a45",
    "requestId": "3f4d0e8b-7a6c-4f1e-9b2d-5a7c8e1f0a3b"
  },
  "message": "API request rejected error.",
  "detail": "A retry for this run is already in progress. Wait for it to finish before retrying again.",
  "solution": "Read error detail and try again."
}

Success and readback#

HTTP 200 with requested, queued, skipped, sideEffects, alreadyRequested and reExecution.
queued: 1 with alreadyRequested: false means a retry was accepted. Read back with GET /{workflowId}/runs: a new run appears with its own id, and the original run keeps its result.
alreadyRequested: true means the platform replayed the answer it recorded for this run and this Idempotency-Key. The body is the original answer, so queued: 1 describes the first call rather than this one. A replay is served for 24 hours, whether or not the ten-minute claim is still held.
sideEffects: "real" is always present. A retry is a real execution.

Errors and recovery#

Status and codeWhenRecovery
401 AUTHENTICATION_REQUIREDNo key, or an unknown keySend a valid key.
403 API_KEY_PERMISSION_DENIEDThe key has no workflowBuilder permissionGrant the permission.
404 RUN_NOT_FOUNDUnknown run id, or a run of another communityUse a run id from the list.
409 RETRY_IN_PROGRESSA retry of this run is already claimed, and the call carried no key or a different keyWait for the queued retry to finish, then read the runs list.
429 RATE_LIMITEDThe community's API rate limit was reachedWait for the window to reset, then retry.
500 INTERNAL_ERRORUnexpected failureRead the runs list before retrying: the retry may already be queued.

Retry safety#

This is the one call in the family whose whole point is a controlled repeat, so its own retry behaviour matters. Two guards run in this order:
1.
A recorded answer for your key is checked first. If this run already accepted a retry under your Idempotency-Key, the platform returns that answer with alreadyRequested: true and queues nothing. The record lasts 24 hours, so a client that retries after a timeout still cannot queue a second re-run, even long after the first claim expired.
2.
Otherwise a claim is taken on the run and its current state. While that claim is held, a call with no key or a different key is refused with 409 RETRY_IN_PROGRESS and queues nothing. Two retries of one failed run can therefore never both queue.
3.
The claim lasts ten minutes. After it expires, a call with a new key or no key takes a new claim and queues a new re-run: the workflow really executes again, so a reward step can pay twice. Only the same key is protected, and only by the 24-hour record.
If queueing itself fails, the claim is released, so a failed attempt does not block a legitimate retry. Use an Idempotency-Key on every retry: it is what turns a lost response into a replay instead of a refusal.

Gotchas#

A retry runs the whole workflow again. It does not continue from the failed step, so a step that already paid a reward runs again and may pay again.
Only a failed run of a workflow that is currently deployed is queued. Anything else is skipped with queued: 0 and a reason in skipped, including a run that succeeded, a run that is still in progress, and a workflow that is no longer deployed.
A retry runs the workflow's current deployed steps with the failed run's recorded trigger output. It is the same event as far as the steps are concerned, against the configuration as it is now, so a step you changed after the failure runs in its new form.
The response describes the request, not the result. Read the runs list for the outcome.
There is no dry run of a retry: it is a real execution by definition, and the response says sideEffects: "real" on every answer. If you want to know what the retry will do, dry-run the workflow (POST /{workflowId}/test with mode: "dry-run") before queueing it.

Next steps#

GET /{workflowId}/runs to confirm a new run appears.
GET /runs/{runId} on the new run for its step results.
PATCH /{workflowId}/nodes/{nodeId} to fix the step that failed before retrying again.

Request

Path Params

Header Params

Responses

🟢200200 Success
application/json
Whether a retry was queued.
Bodyapplication/json

🟠400400 VALIDATION_FAILED
🟠401401 AUTHENTICATION_REQUIRED / API_KEY_REQUIRED
🟠403403 API_KEY_PERMISSION_DENIED
🟠404404 RUN_NOT_FOUND
🟠409409 RETRY_IN_PROGRESS
🟠429429 RATE_LIMITED
🔴500500 INTERNAL_ERROR
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.returning.ai/v1/workflow-builder/data-workflows/runs/65f1a2b3c4d5e6f708192a40/retry' \
--header 'Authorization: Bearer <API_KEY>' \
--header 'Idempotency-Key: create-vip-bonus-001'
Response Response Example
200 - 200 Success
{
  "data": {
    "requested": 1,
    "queued": 1,
    "skipped": [],
    "sideEffects": "real",
    "alreadyRequested": false,
    "reExecution": "The whole workflow runs again from the trigger, including steps that already succeeded, paid rewards or called outside services."
  }
}
Modified at 2026-10-28 04:54:56
Previous
Get one run
Next
Call the workflow tools over MCP
Built with