Skip to main content

Workflows

Deploy, trigger, and manage AI-powered workflows programmatically. Workflows are multi-step automation pipelines built in the Jabrod visual editor.

Deploy a Workflow

Deploy a workflow to a cloud endpoint:
const deployment = await jabrod.workflows.deploy({
  workflowId: 'your-workflow-id',
  subdomain: 'my-data-pipeline'  // optional custom subdomain
});

console.log('Deployed at:', deployment.deployedUrl);
// => https://my-data-pipeline.cloud.jabrod.com
console.log('Status:', deployment.status);

List Deployed Workflows

Get all your deployed workflows:
const workflows = await jabrod.workflows.list();

for (const wf of workflows) {
  console.log(`${wf.name}${wf.deployedUrl} (${wf.status})`);
}

Trigger a Deployed Workflow

Trigger execution of a deployed workflow with custom input:
const result = await jabrod.workflows.trigger({
  subdomain: 'my-data-pipeline',
  input: {
    prompt: 'Generate a weekly report',
    format: 'markdown'
  }
});

console.log('Output:', result.output);
console.log('Duration:', result.durationMs, 'ms');

Execute by Workflow ID

Execute a workflow directly by its ID (webhook-style):
const result = await jabrod.workflows.execute(
  'your-workflow-id',
  { data: 'process this input' }
);

console.log(result.output);

Check Deployment Status

Monitor the deployment status of a workflow:
const status = await jabrod.workflows.status('my-data-pipeline');

console.log('Status:', status.status);       // 'deployed' | 'deploying' | 'failed'
console.log('URL:', status.deployedUrl);
console.log('Deployed at:', status.deployedAt);

Undeploy a Workflow

Remove a deployed workflow:
await jabrod.workflows.undeploy('my-data-pipeline');
console.log('Workflow undeployed successfully');

Workflow Limits

FeatureFreeProEnterprise
Deployed workflows220Unlimited
Nodes per workflow1050Unlimited
Executions/month10010,000Unlimited
Scheduled triggers

Complex Inputs

Pass structured data objects to your workflows. The workflow can access these values using the {{input.key}} syntax in nodes.
const result = await jabrod.workflows.trigger({
  subdomain: 'lead-qualification',
  input: {
    user: {
      name: 'John Doe',
      email: 'john@example.com',
      company: 'Acme Corp'
    },
    source: 'web_form',
    timestamp: new Date().toISOString()
  }
});

Error Handling

Wrap workflow executions in try/catch blocks to handle potential failures:
try {
  const result = await jabrod.workflows.trigger({
    subdomain: 'critical-pipeline',
    input: { data: '...' }
  });

  if (result.status === 'failed') {
    console.error('Workflow failed:', result.error);
  } else {
    console.log('Success:', result.output);
  }
} catch (error) {
  console.error('Network or API error:', error);
}

Webhook Integration

Deployed workflows can be triggered as webhooks from external services. Use the execute endpoint URL:
curl -X POST https://cloud.jabrod.com/v1/workflows/{workflowId}/execute \
  -H "Content-Type: application/json" \
  -d '{"prompt": "Process this data"}'