POST /v1/workflows/{id}/rollback
Rollback workflow to a previous version
POST
/v1/workflows/{id}/rollback
Rollback workflow to a previous version
Path Parameters
id
string
required
path
Workflow ID
Request Body required
Rollback params
application/jsonOne of:
Option 1
Option 2
expectedCurrentVersion
integer
targetVersion
integer
REQUIRED
Responses
200
OK
application/jsoncode
integer
data
object
aiDescription
string
aiName
string
conversationId
string
cooldownMs
integer
createdAt
string
createdBy
string
definition
object
Definition is the inline workflow graph to analyze. Same shape as a
saved workflow's definition. Unlike the ephemeral-run endpoint there
is no trigger restriction — analysis is read-only and method-agnostic.
blockExpansions
object
Set on run snapshots only (not workflow DB)
inputSchema
object[]
Array of:
description
string
key
string
required
boolean
type
string
"string", "number", "boolean", "object", "array"
nodes
object
REQUIRED
triggerNodeIds
string[]
TriggerNodeIDs lists the node IDs that are trigger (root) nodes. Every
workflow declares this — single-trigger workflows ship ["root"] (the
legacy node id), multi-trigger workflows list every trigger node id.
Treating single-trigger as a forest-of-1 removes the two-path branching
throughout the BE + FE; older rows without the field are backfilled by
migration 000282 and the field-missing path stays as a read-side safety
net (see FindTriggerNodeIDs) but is no longer exercised by saves.
"root" is also a runtime alias for "the trigger that fired this run" —
{{root.X}} variable references resolve to the firing trigger regardless
of which trigger fired. Don't repurpose the literal "root" as a trigger
id on a multi-trigger workflow.
Array of:
variableDefs
object[]
VariableDefs is a snapshot of the workflow's declared variables at run
creation time. The canonical source lives on the workflows row
(Workflow.VariableDefs column). Snapshotted into the run definition
so the worker can resolve {{$vars.x}} lookups and route variable-action
writes to the right scope without an extra DB round trip.
Array of:
default
unknown
description
string
lifetime
string
Enum:
persist, resetname
string
type
string
Enum:
number, text, boolean, list, objectdescManuallySet
boolean
description
string
fundAutoSwapConfig
object
enabled
boolean
maxSwapAmountUsd
number
mode
string
sources
object[]
Array of:
chainId
integer
ChainID is the source chain to sell from.
id
string
ID is a unique identifier for this source (e.g., "src_abc123").
priority
integer
Priority controls order of evaluation (lower = tried first).
slippageBps
integer
SlippageBps is the slippage tolerance in basis points. Default 300 (3%).
tokenAddress
string
TokenAddress is the token to sell. Use "native" for native gas tokens.
tokenDecimals
integer
TokenDecimals is the number of decimal places for the token (e.g. 18 for ETH, 6 for USDC).
Stored so the UI can display the human-readable amount without re-fetching on-chain metadata.
walletId
string
WalletID is the org wallet to sell from.
hasDraft
boolean
Response-only fields (not persisted to database)
HasDraft indicates a draft exists (for live workflows in API responses)
hasLiveVersion
boolean
HasLiveVersion indicates a live version exists (for drafts in API responses)
id
string
lastTriggeredAt
string
maxRuns
integer
name
string
nameManuallySet
boolean
organizationId
string
ownerUserId
string
pausedReason
string
Enum:
cu_exhausted, disabled_action, consecutive_failures, max_runs_exhausted, invalid_chat, member_removedpublicRunCooldownSeconds
integer
publicRunDailyLimit
integer
publicWidgetConfig
object
buttonLabel
string
ButtonLabel is the text displayed on the trigger button
description
string
Description explains what the workflow does
enabled
boolean
Enabled controls whether the public widget is active
maxAmount
string
MaxAmount is the maximum amount allowed per trigger (in smallest unit)
minAmount
string
MinAmount is the minimum amount required to trigger (in smallest unit)
title
string
Title is the display title for the widget
remainRuns
integer
sourceTemplateId
string
status
string
Enum:
draft, active, paused, archivedtriggerSecret
string
type
string
Enum:
token-price-cexes, evm-log, cronjob, schedule, manual, approval, telegram-channel, polymarket-user-bet, polymarket-market-trade, polymarket-new-market, polymarket-market-close, slack-mentions, erc20-receive, erc20-send, anyspend, shopify-order-created, shopify-order-paid, shopify-inventory-level-updated, ramp-new-transaction, ramp-transaction-status-updated, ramp-transfer-payment-updated, slack-new-reaction-added, slack-new-message-in-channels, slack-new-channel-created, slack-new-direct-message, slack-new-keyword-mention, slack-new-user-added, slack-new-user-mention, slack-new-interaction-event, telegram-new-interaction-event, email-new-email-received, email-new-email-matching-criteria, gmail-new-email-received, gmail-new-email-matching-search, stripe-payment-receive, eth-receive, eth-send, farcaster-new-cast, farcaster-new-follower, farcaster-new-reaction, x-new-tweet, exchange-listing, coinbase-payment-received, coinbase-checkout-received, solana-transaction, hyperliquid-price-alert, hyperliquid-trade, hyperliquid-user-fill, hyperliquid-liquidation, hyperliquid-position-change, hyperliquid-transfer, unusual-whales-options-flow-alerts, unusual-whales-market-news, kalshi-market-trade, kalshi-new-market, kalshi-market-closeuiMetadata
object
comments
object[]
Array of:
createdAt
string
createdBy
object
clientId
string
name
string
id
string
nodeId
string
position
object
x
number
y
number
replies
object[]
Array of:
createdAt
string
createdBy
object
...
id
string
text
string
updatedAt
string
resolved
boolean
text
string
updatedAt
string
nodePositions
object
stickyNotes
object[]
Array of:
color
string
createdAt
string
createdBy
object
clientId
string
name
string
id
string
position
object
x
number
y
number
size
object
height
number
width
number
text
string
updatedAt
string
zIndex
integer
updatedAt
string
updatedBy
string
variableDefs
object[]
Array of:
default
unknown
description
string
lifetime
string
Enum:
persist, resetname
string
type
string
Enum:
number, text, boolean, list, objectversion
integer
versionCreatedBy
string
VersionCreatedBy is the user who authored THIS version row. Unlike
CreatedBy (asset creator, copied to every version for ownership) and
UpdatedBy (overwritten by lifecycle ops like archiving), it is stamped
once at version insert and never mutated.
visibility
string
Enum:
private, org, public_view, public_executex402Config
object
chainId
integer
Chain ID where payment should be made (e.g., 8453 for Base)
discoverable
boolean
Discoverable controls whether this workflow is listed in the Bazaar public catalog.
Bazaar is a discovery marketplace where users can find and pay for x402-enabled endpoints.
When true: Endpoint is publicly listed, anyone can trigger with payment only (no secret needed).
When false: Endpoint is private, requires both secret and payment to trigger.
discoveryInput
object
example
unknown
Example provides a sample value for documentation and testing
schema
object
Schema is a JSON Schema definition for validation
discoveryMetadata
object
category
string
Category groups workflows (e.g., "data", "automation", "ai")
description
string
Description provides details about what the workflow does
documentation
string
Documentation URL for additional documentation
logo
string
Logo URL for the workflow/provider logo
name
string
Name is the display name for the workflow
provider
string
Provider is the name of the entity providing this workflow
tags
string[]
Tags for searchable keywords
Array of:
discoveryOutput
object
example
unknown
Example provides a sample value for documentation and testing
schema
object
Schema is a JSON Schema definition for validation
price
string
Price in the smallest unit of the token (e.g., wei for ETH, 6 decimals for USDC)
recipient
string
Recipient address that will receive the payment
token
string
Token address (e.g., USDC contract address)
message
string
requestId
string
400
Bad Request
404
Not Found
curl -X POST 'https://api.example.com/v1/workflows/string/rollback' \ -H 'Authorization: Bearer YOUR_API_TOKEN' \ -H 'Content-Type: application/json' \ -d '{}'
const response = await fetch('https://api.example.com/v1/workflows/string/rollback', { method: 'POST', headers: { "Authorization": "Bearer YOUR_API_TOKEN", "Content-Type": "application/json" }, body: JSON.stringify({})});const data = await response.json();console.log(data);
import requestsheaders = { 'Authorization': 'Bearer YOUR_API_TOKEN'}response = requests.post('https://api.example.com/v1/workflows/string/rollback', headers=headers, json={})print(response.json())
package mainimport ( "fmt" "io" "net/http" "strings")func main() { body := strings.NewReader(`{}`) req, _ := http.NewRequest("POST", "https://api.example.com/v1/workflows/string/rollback", body) req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() result, _ := io.ReadAll(resp.Body) fmt.Println(string(result))}
200
Response
{ "code": 200, "data": { "aiDescription": "<string>", "aiName": "<string>", "conversationId": "<string>", "cooldownMs": 123, "createdAt": "<string>", "createdBy": "<string>", "definition": { "blockExpansions": "<object>", "inputSchema": [ { "description": "<string>", "key": "<string>", "required": true, "type": "<string>" } ], "nodes": "<object>", "triggerNodeIds": [ "<string>" ], "variableDefs": [ { "default": "<unknown>", "description": "<string>", "lifetime": "persist", "name": "<string>", "type": "number" } ] }, "descManuallySet": true, "description": "<string>", "fundAutoSwapConfig": { "enabled": true, "maxSwapAmountUsd": 123, "mode": "<string>", "sources": [ { "chainId": 123, "id": "<string>", "priority": 123, "slippageBps": 123, "tokenAddress": "<string>", "tokenDecimals": 123, "walletId": "<string>" } ] }, "hasDraft": true, "hasLiveVersion": true, "id": "<string>", "lastTriggeredAt": "<string>", "maxRuns": 123, "name": "<string>", "nameManuallySet": true, "organizationId": "<string>", "ownerUserId": "<string>", "pausedReason": "cu_exhausted", "publicRunCooldownSeconds": 123, "publicRunDailyLimit": 123, "publicWidgetConfig": { "buttonLabel": "<string>", "description": "<string>", "enabled": true, "maxAmount": "<string>", "minAmount": "<string>", "title": "<string>" }, "remainRuns": 123, "sourceTemplateId": "<string>", "status": "draft", "triggerSecret": "<string>", "type": "token-price-cexes", "uiMetadata": { "comments": [ { "createdAt": "<string>", "createdBy": { "clientId": {}, "name": {} }, "id": "<string>", "nodeId": "<string>", "position": { "x": {}, "y": {} }, "replies": [ {} ], "resolved": true, "text": "<string>", "updatedAt": "<string>" } ], "nodePositions": "<object>", "stickyNotes": [ { "color": "<string>", "createdAt": "<string>", "createdBy": { "clientId": {}, "name": {} }, "id": "<string>", "position": { "x": {}, "y": {} }, "size": { "height": {}, "width": {} }, "text": "<string>", "updatedAt": "<string>", "zIndex": 123 } ] }, "updatedAt": "<string>", "updatedBy": "<string>", "variableDefs": [ { "default": "<unknown>", "description": "<string>", "lifetime": "persist", "name": "<string>", "type": "number" } ], "version": 123, "versionCreatedBy": "<string>", "visibility": "private", "x402Config": { "chainId": 123, "discoverable": true, "discoveryInput": { "example": "<unknown>", "schema": "<object>" }, "discoveryMetadata": { "category": "<string>", "description": "<string>", "documentation": "<string>", "logo": "<string>", "name": "<string>", "provider": "<string>", "tags": [ "<string>" ] }, "discoveryOutput": { "example": "<unknown>", "schema": "<object>" }, "price": "<string>", "recipient": "<string>", "token": "<string>" } }, "message": "success", "requestId": "abc-123"}
API Playground
Try this endpoint
POST
/v1/workflows/{id}/rollback
