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.list1({ workflowId: 'workflowId' })) {
console.log(workflowVersion.id);
}{
"data": [
{
"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"
}
],
"page": 0,
"lastPage": 2
}Retrieves a paginated list of workflow versions for a specific workflow. Accepts both public and secret keys.
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.list1({ workflowId: 'workflowId' })) {
console.log(workflowVersion.id);
}{
"data": [
{
"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"
}
],
"page": 0,
"lastPage": 2
}Chave de API do tenant (publishable key ou secret key)
Chave de API do tenant (publishable key ou secret key)
Search for versions by name or description
Filter by active versions
Number of versions per page
20
Page number (zero-based)
0
Workflow identifier
Was this page helpful?