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",
  "subTenantId": "sub_tenant_456",
  "version": 1,
  "nodes": [
    {
      "id": "node_abc123def456",
      "type": "trigger",
      "version": "1.0.0",
      "name": "Send Email",
      "description": "Sends an email notification",
      "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
      }
    }
  ],
  "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",
  "publishedAt": "2024-01-15T10:30:00.000Z"
}

Authorizations

X-API-Key
string
header
required

Headers

X-API-Key
string
required

Path Parameters

versionId
string
required
Example:

Body

application/json
nodes
object[]
edges
object[]

Response

id
string
required
Example:
workflowId
string
required
Example:
tenantId
string
required
Example:
version
number
required
Example:
nodes
object[]
required
edges
object[]
required
isActive
boolean
required
Example:
createdAt
string
required
Example:
subTenantId
string
Example:
publishedAt
string
Example: