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

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

const response = await client.workflows.versions.publish('wfv_abc123def456');

console.log(response.message);
{
  "message": "Workflow version published successfully",
  "version": {
    "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:

Response

message
string
required
Example:
version
object
required