Skip to main content
PATCH
/
v1
/
gateway
/
workflow-versions
/
{versionId}
JavaScript
import Triglit from 'triglit';

const client = new Triglit({
  apiKey: 'My API Key',
});

const workflowVersion = await client.workflows.versions.update('wfv_abc123def456');

console.log(workflowVersion.id);
{
  "id": "wfv_abc123def456",
  "workflowId": "wf_abc123def456",
  "tenantId": "tenant_123",
  "version": 1,
  "nodes": [
    {
      "id": "node_abc123def456",
      "type": "trigger",
      "version": "1.0.0",
      "name": "Send Email",
      "config": {
        "recipientType": "email",
        "template": "welcome"
      },
      "inputSchema": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string"
          },
          "subject": {
            "type": "string"
          }
        }
      },
      "outputSchema": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "messageId": {
            "type": "string"
          }
        }
      },
      "canPause": false,
      "position": {
        "x": 100,
        "y": 200
      },
      "description": "Sends an email notification"
    }
  ],
  "edges": [
    {
      "id": "edge_abc123def456",
      "sourceNodeId": "node_abc123def456",
      "targetNodeId": "node_xyz789uvw123",
      "sourceOutputKey": "onSuccess",
      "targetInputKey": "input",
      "condition": "result.success === true",
      "label": "On Success"
    }
  ],
  "isActive": true,
  "createdAt": "2024-01-15T10:30:00.000Z",
  "subTenantId": "sub_tenant_456",
  "publishedAt": "2024-01-15T10:30:00.000Z"
}

Authorizations

X-API-Key
string
header
required

Chave de API do tenant (publishable key ou secret key)

Headers

X-API-Key
string
required

Chave de API do tenant (publishable key ou secret key)

Path Parameters

versionId
string
required

Workflow version identifier

Example:

"wfv_abc123def456"

Body

application/json
nodes
object[]
edges
object[]

Response

Workflow version updated successfully

id
string
required

Unique workflow version identifier

Example:

"wfv_abc123def456"

workflowId
string
required

Parent workflow identifier

Example:

"wf_abc123def456"

tenantId
string
required

Tenant identifier

Example:

"tenant_123"

version
number
required

Version number

Example:

1

nodes
object[]
required

Workflow nodes

edges
object[]
required

Workflow edges

isActive
boolean
required

Whether this version is active

Example:

true

createdAt
string
required

Creation timestamp

Example:

"2024-01-15T10:30:00.000Z"

subTenantId
string

Sub-tenant identifier

Example:

"sub_tenant_456"

publishedAt
string

Publication timestamp

Example:

"2024-01-15T10:30:00.000Z"