Skip to main content
GET
/
v1
/
gateway
/
workflows
/
{workflowId}
/
versions
JavaScript
import Triglit from 'triglit';

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

// Automatically fetches more pages as needed.
for await (const workflowVersion of client.workflows.versions.list0('wf_abc123def456')) {
  console.log(workflowVersion.id);
}
{
  "data": [
    {
      "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"
    }
  ],
  "page": 0,
  "lastPage": 2
}

Authorizations

X-API-Key
string
header
required

Headers

X-API-Key
string
required

Path Parameters

workflowId
string
required
Example:

Query Parameters

isActive
boolean
pageSize
number
Example:
page
number
Example:

Response

data
object[]
required
page
number
required
Example:
lastPage
number
required
Example: