Best Practices

Best Practices

  1. Search first: Use semantic search to find the right workflow
  2. Check metadata: Review workflow description and input requirements before executing
  3. Use appropriate inputs: Provide all required inputs for multi-step processing
  4. Monitor execution: Track workflow progress and intermediate results
  5. Handle errors: Implement retry logic for failed workflow executions
  6. Version control: Pin to specific workflow versions for consistency

Pricing

Workflows are billed based on token usage across all steps:

  • Input tokens: Documents, text, and configuration across all workflow steps
  • Output tokens: Generated content, summaries, and structured data
  • Service calls: OCR, transcription, and other integrated services

Cost breakdown is shown in the execution response usage object.


Error Handling

Workflow Not Found

{
  "error": {
    "code": "WORKFLOW_NOT_FOUND",
    "message": "Workflow with id 'xyz' not found or not published"
  }
}

Invalid Input

{
  "error": {
    "code": "INVALID_INPUT",
    "message": "Workflow input validation failed: [details]"
  }
}

Execution Failed

{
  "error": {
    "code": "EXECUTION_FAILED",
    "message": "Workflow execution failed at step 'ocr_processing': [reason]"
  }
}

Security

  • Workflow definitions secure: Workflows are server-side and version controlled
  • API key authentication: Required for all requests
  • Usage tracking: Per organization and API key
  • Rate limiting: Per API key to prevent abuse
  • Input validation: All inputs are validated and sanitized
  • Step-by-step auditing: Execution logs for compliance and debugging