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

Validate a stored workflow

POST
/v1/workflow-builder/data-workflows/{workflowId}/validate
POST /{workflowId}/validate needs workflowBuilder.

What this endpoint does#

Runs the same static check that deploy runs, without changing anything: each step's options against its type's schema, every reference resolving to an earlier step or the trigger, router branch shape and operators, retries that repeat side effects, credentials an import left empty, user-field keys, and leaderboard ownership.
It is advisory. Every finding comes back in warnings, errors is always empty, and valid is always true: it does not tell you whether anything was found, so read warnings. No finding here refuses a deploy: deploy runs the same check, returns the same list as warnings, and proceeds either way. Deploy refuses only on its two tenant checks, a router branch that lists a step from another workflow (400 NODE_NOT_IN_WORKFLOW) and a leaderboard from another community (400 LEADERBOARD_NOT_IN_COMMUNITY); validate reports both as warnings. Read the report, decide, and fix what matters.
Nothing is executed and nothing is written, so a key that only inspects workflows can check one before anyone deploys it.

Quick start#

Authentication and permission#

Authorization: Bearer <API_KEY> with workflowBuilder. No If-Match is needed because the call writes nothing: it always validates the stored workflow, and the body is ignored.
FailureMeaningRecovery
403 API_KEY_PERMISSION_DENIEDThe key has no workflowBuilder permissionGrant the permission.
404 WORKFLOW_NOT_FOUNDUnknown id, or another community's workflowUse an id from this community.

Complete examples#

A clean workflow:
{
  "data": {
    "valid": true,
    "errors": [],
    "warnings": [],
    "revision": "162af81f5de4ff2b557a4087de9a9a73a0ed4e621f737787e35a93614cb50d1c"
  }
}
A workflow whose router uses an OR condition group, plus a reference to a branch step that may not run. Both are warnings, valid is still true, and the workflow can be deployed exactly as it is:
{
  "data": {
    "valid": true,
    "errors": [],
    "warnings": [
      {
        "nodeId": "65f1a2b3c4d5e6f708192a3e",
        "path": "options.branches[0].conditions[0].operator",
        "code": "ROUTER_OPERATOR_UNSAFE",
        "message": "The runtime treats OR and WHERE condition groups as always true."
      },
      {
        "nodeId": "65f1a2b3c4d5e6f708192a3d",
        "path": "options.fields[0].value",
        "code": "REFERENCE_MAY_BE_UNSET",
        "message": "This reads a branch step that may not run; the value can be unset."
      }
    ],
    "revision": "68f78253046393414dec404e5442c140bb5db0393a7d1c389ff57bba71585501"
  }
}

Success and readback#

HTTP 200 whenever the workflow was read and checked, whatever the report says: a workflow with warnings is a successful validation with valid: true, an empty errors and a non-empty warnings. There is no state change, so the readback is the report itself plus revision, which is stable until the next authored change.
Warning codes a report can carry. None of them stops a deploy. deploy returns the same list in its own warnings, so a workflow can go live with every code below present:
codeMeaning
NODE_OPTIONS_INVALIDThe step's options do not match its type's schema.
NODE_NAME_REQUIREDA step has no name.
NODE_TYPE_UNKNOWNA stored step has a type the API does not describe.
NODE_NOT_ON_WORKFLOWA step exists but is not part of the workflow's order.
NODE_NOT_IN_WORKFLOWA router branch names a step that is not in this workflow.
TRIGGER_TYPE_UNKNOWNThe stored trigger type is not one the API describes.
TRIGGER_OPTIONS_INVALIDThe stored trigger options do not match the trigger type. A trigger that stores no options at all is valid: an event ingest trigger takes its defaults, and a webhook trigger reads as "no options", so a workflow built in the canvas validates cleanly here.
BRANCH_REQUIREDA router has no branches.
BRANCH_TYPE_INVALIDA branch is neither CONDITION nor FALLBACK.
BRANCH_MEMBER_MISSINGA branch names a step that is not in the workflow.
NODE_LISTED_TWICEOne step id is listed more than once across a router's branch lists, so a run would execute it more than once.
MISSING_SECRETA credential an import blanked is still empty, so the step will run without it.
LEADERBOARD_NOT_IN_COMMUNITYA stored leaderboard step names a leaderboard this community does not have.
POST_LOGIC_REQUIREDA write step's field does not send logic explicitly, and the default overwrite can zero a balance.
DUPLICATE_FIELD_LABELTwo fields in one step use the same label, so the last value wins at run time.
EMPTY_FIELD_LABELA step whose output another step reads has an empty field label, so the value cannot be addressed.
RETRY_REPEATS_SIDE_EFFECTSretryOnFailure is set on a router whose branches contain a step that pays, sends mail or calls outside the service, or on a write step that sets more than one field. Retrying either repeats several side effects at once. A single HTTP, email, bulk or one-field write step may use retryOnFailure.
REFERENCE_TO_SELFA step reads its own output.
REFERENCE_UNRESOLVEDA reference points at a step that does not run before it on its own path.
REFERENCE_NOT_UPSTREAMA reference points at a step that is not earlier on the same path.
REFERENCE_UNRESOLVABLEA reference object, or a {{...}} template whose first part is a 24-hex id, names a step that is not in this workflow.
TEMPLATE_NOT_A_REFERENCEA {{...}} whose first part is not a step id at all, for example {{amount}}. The run leaves the text as it is, so the value never resolves.
REFERENCE_UNKNOWN_FIELDA reference names a label the step it reads does not produce.
REFERENCE_SHAPE_MISMATCHA reference reads a number or a list as if it were an object, for example reading a field off a math step.
ROUTER_OPERATOR_UNSAFEA condition group uses OR or WHERE, or a condition uses the "is empty" or "is not empty" operator. The runtime treats an OR or WHERE group as always true, so the branch fires more often than the author meant. Use AND groups.
ROUTER_OPERATOR_UNKNOWNThe router does not know the operator for that condition's type, so the condition would always be false. It is also reported for a boolean condition using is true or is false with no value.
ROUTER_EMPTY_CONDITIONA condition branch has no conditions, so it cannot gate anything.
ROUTER_MULTIPLE_GROUPSA branch carries more than one condition group, and only the last one is evaluated.
UNKNOWN_USER_FIELDA stored platform-action field key is not one the backend computes, so the step reads or writes nothing. A key with leading or trailing spaces is reported too, because field names must match exactly.
REFERENCE_MAY_BE_UNSETThe reference is to a branch step that may not have run, so its value can be unset.
TRIGGER_REQUIREDThe workflow has no trigger. It deploys and never runs until one is set.
The router and reference rows come from the same rules the run path uses, including its operator tables. That is what makes the report worth reading even though it refuses nothing: it names exactly what a run will ignore or misread.

Errors and recovery#

Status and codeWhenRecovery
400 VALIDATION_FAILEDThe id is not 24 hexadecimal characters, or the body is not a JSON objectSend {} and a valid id.
401 AUTHENTICATION_REQUIREDNo key, or an unknown keySend a valid key.
403 API_KEY_PERMISSION_DENIEDNo workflowBuilderGrant the permission.
404 WORKFLOW_NOT_FOUNDUnknown id, or another community's workflowUse an id from this community.
415 UNSUPPORTED_MEDIA_TYPEThe body was not declared application/jsonSend the header with {}.
429 RATE_LIMITEDThe community's API rate limit was reachedWait for the window to reset, then retry.
500 INTERNAL_ERRORUnexpected failureRetry with bounded backoff.

Retry safety#

Safe to retry: it never writes and never executes a step. The report can differ between calls only because the workflow changed, so compare revision between reports rather than assuming they describe the same state.

Gotchas#

A report with warnings is deployable, and valid stays true either way: check whether warnings is empty, not valid. The platform accepts every one of these and then behaves as described.
MISSING_SECRET appears only for credentials that were blanked by an import. A step whose authentication is deliberately empty is not reported. Because deploy does not refuse on it, an imported workflow can go live with a credential still missing: fill every path in secretsToFill first.
Validation checks run order, not creation order: a reference may only read the trigger or a step that has already run on the same path. A step after a router cannot read a step inside one branch without a warning.
A router branch that uses OR or WHERE is stored without complaint, deploys, and then evaluates as always true. Build conditions with AND groups and treat ROUTER_OPERATOR_UNSAFE as an editing task, not a blocker.
Validation is not a test. It does not resolve member data, call an outside system, or prove that a leaderboard has members.
validate writes nothing, so it is the cheapest way to check a workflow before you deploy or hand it over. It reaches outside the workflow only for two scoped reads: leaderboard ids and the community's user-field catalog.

Next steps#

PATCH /{workflowId}/nodes/{nodeId} to fix a named problem.
POST /{workflowId}/test with mode: "dry-run" for a side-effect-free walk of the whole workflow.
POST /{workflowId}/deploy once the warnings are what you expect; its response repeats them.

Request

Path Params

Header Params

Body Params application/jsonRequired

Examples

Responses

🟢200200 Success
application/json
The static check result. The body is not used; the stored workflow is what is checked.
Bodyapplication/json

🟠400400 VALIDATION_FAILED
🟠401401 AUTHENTICATION_REQUIRED / API_KEY_REQUIRED
🟠403403 API_KEY_PERMISSION_DENIED
🟠404404 WORKFLOW_NOT_FOUND
🟠413413 VALIDATION_FAILED
🟠415415 UNSUPPORTED_MEDIA_TYPE
🟠429429 RATE_LIMITED
🔴500500 INTERNAL_ERROR
Request Request Example
Shell
JavaScript
Java
Swift
curl --location 'https://api.returning.ai/v1/workflow-builder/data-workflows/65f1a2b3c4d5e6f708192a3b/validate' \
--header 'Authorization: Bearer <API_KEY>' \
--header 'Content-Type: application/json' \
--data '{}'
Response Response Example
200 - 200 Success
{
  "data": {
    "valid": true,
    "errors": [],
    "warnings": [],
    "revision": "162af81f5de4ff2b557a4087de9a9a73a0ed4e621f737787e35a93614cb50d1c"
  }
}
Modified at 2026-10-28 04:46:32
Previous
Export a workflow definition
Next
Create or replace the trigger
Built with