Reusability

Templates

Start from pre-built workflow templates or export your own workflows as reusable JSON blueprints.

What are Templates?

Templates are JSON files that describe a complete workflow definition including steps, edges, and metadata. They can be imported to create a new workflow instance, or exported from an existing workflow for sharing and version control.

Importing a Template

Import templates via the API or the Templates page in the UI.

POST /api/templates/import/:id
# Import template by its registered ID
POST /api/templates/import/daily-report-generator
Authorization: Bearer <token>

Validating a Template

Before importing, validate that a template has correct step IDs, edge references, and node types.

GET /api/templates/:id/validate
{
  "ok": true,
  "valid": true,
  "errors": [],
  "warnings": []
}

Exporting a Workflow

Export any workflow you own as a JSON template. The exported file contains the full workflow definition including steps, edges, and node metadata.

GET /api/workflows/:workflowId/export
# Returns a JSON file with the workflow definition
GET /api/workflows/wf_123/export
Authorization: Bearer <token>

Built-in Templates

The platform ships with starter templates for common automation tasks. You can view the list via the Templates API.

GET /api/templates
{
  "ok": true,
  "templates": [
    {
      "id": "daily-report",
      "name": "Daily Report Generator",
      "description": "Summarize data and email a daily report.",
      "steps": [ ... ],
      "edges": [ ... ]
    }
  ]
}

Tips

  • Store templates in version control to share workflows across teams.
  • Use the clone endpoint (POST /api/workflows/:id/clone) to duplicate a workflow before editing.
  • Version history is preserved when importing from a template.