import Triglit from 'triglit';
const client = new Triglit({
apiKey: 'My API Key',
});
const workflow = await client.workflows.toggleStatus('wf_abc123def456');
console.log(workflow.id);{
"id": "wf_abc123def456",
"tenantId": "tenant_123",
"name": "User Onboarding Workflow",
"isActive": true,
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-01-15T10:30:00.000Z",
"subTenantId": "sub_tenant_456",
"description": "Automated workflow for new user onboarding"
}Toggles the active/inactive status of a workflow. If active, becomes inactive; if inactive, becomes active. Accepts both public and secret keys.
import Triglit from 'triglit';
const client = new Triglit({
apiKey: 'My API Key',
});
const workflow = await client.workflows.toggleStatus('wf_abc123def456');
console.log(workflow.id);{
"id": "wf_abc123def456",
"tenantId": "tenant_123",
"name": "User Onboarding Workflow",
"isActive": true,
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-01-15T10:30:00.000Z",
"subTenantId": "sub_tenant_456",
"description": "Automated workflow for new user onboarding"
}Chave de API do tenant (publishable key ou secret key)
Chave de API do tenant (publishable key ou secret key)
Workflow identifier
"wf_abc123def456"
Workflow status toggled successfully
Unique workflow identifier
"wf_abc123def456"
Tenant identifier
"tenant_123"
Workflow name
"User Onboarding Workflow"
Whether the workflow is active
true
Creation timestamp
"2024-01-15T10:30:00.000Z"
Last update timestamp
"2024-01-15T10:30:00.000Z"
Sub-tenant identifier
"sub_tenant_456"
Workflow description
"Automated workflow for new user onboarding"
Was this page helpful?