Workflows

For Coding Agents

workflows.md

AGNT Workflows

Agents shouldn't reinvent the wheel every time someone asks them to do the same thing. AGNT Workflows let you define task templates — standardized configurations for repeatable work. Schedule a meeting, draft a follow-up, research a topic — define the template once, run it as many times as you need.

Why AGNT Workflows

Without templates, every task starts from zero. The agent figures out what skill to use, how to configure it, what inputs to expect, and how to structure the output. That works for one-off requests. It's wasteful for the hundredth scheduling task that follows the same pattern.

AGNT Workflows capture the "how" so the agent only needs the "what." A template defines the skill, the configuration, and the variables. At runtime, you fill in the variables and go. Consistent execution. Predictable results. No drift.

Templates also separate the people who design workflows from the people who trigger them. Your operations team builds the template. Your end users (or other agents) just use it.

Quick Start

1. Browse Available Templates

bash
curl https://api.agnt.ai/task-templates \
  -H "Authorization: Bearer $TOKEN"

Response:

json
{
  "success": true,
  "data": [
    {
      "id": "tmpl_schedule_meeting",
      "displayTitle": "Schedule a Meeting",
      "description": "Coordinate a meeting between two or more participants with automatic availability checking.",
      "primarySkillId": "skill_scheduling",
      "secondarySkillIds": ["skill_email"],
      "taskConfig": {
        "priority": "normal",
        "timeoutMinutes": 30,
        "retryOnFailure": true,
        "maxRetries": 2
      },
      "variables": [
        {
          "name": "participants",
          "type": "array",
          "description": "Email addresses of meeting participants",
          "required": true
        },
        {
          "name": "duration",
          "type": "number",
          "description": "Meeting duration in minutes",
          "required": true,
          "default": 30
        },
        {
          "name": "title",
          "type": "string",
          "description": "Meeting title",
          "required": true
        },
        {
          "name": "notes",
          "type": "string",
          "description": "Additional context or agenda items",
          "required": false
        }
      ],
      "createdAt": "2026-01-20T14:00:00.000Z"
    }
  ]
}

2. Filter by Skill

bash
curl "https://api.agnt.ai/task-templates?skillId=skill_scheduling" \
  -H "Authorization: Bearer $TOKEN"

Returns only templates that use the specified skill as their primary skill.

3. Get Template Details

bash
curl https://api.agnt.ai/task-templates/tmpl_schedule_meeting \
  -H "Authorization: Bearer $TOKEN"
json
{
  "success": true,
  "data": {
    "id": "tmpl_schedule_meeting",
    "displayTitle": "Schedule a Meeting",
    "description": "Coordinate a meeting between two or more participants with automatic availability checking.",
    "primarySkillId": "skill_scheduling",
    "secondarySkillIds": ["skill_email"],
    "taskConfig": {
      "priority": "normal",
      "timeoutMinutes": 30,
      "retryOnFailure": true,
      "maxRetries": 2
    },
    "variables": [
      {
        "name": "participants",
        "type": "array",
        "description": "Email addresses of meeting participants",
        "required": true
      },
      {
        "name": "duration",
        "type": "number",
        "description": "Meeting duration in minutes",
        "required": true,
        "default": 30
      },
      {
        "name": "title",
        "type": "string",
        "description": "Meeting title",
        "required": true
      },
      {
        "name": "notes",
        "type": "string",
        "description": "Additional context or agenda items",
        "required": false
      }
    ],
    "createdAt": "2026-01-20T14:00:00.000Z"
  }
}

Core Concepts

Task Templates

A task template is a blueprint for a specific kind of work. It captures everything the agent needs to execute a task except the runtime inputs — those are the variables.

Every template has:

  • Display title and description — what this workflow does, in plain language
  • Primary skill — the main capability this template exercises
  • Secondary skills — additional capabilities the workflow may use
  • Task configuration — execution parameters like priority, timeout, and retry behavior
  • Variables — the inputs that change per execution

Primary vs. Secondary Skills

Every template has one primary skill — the core capability it depends on. A scheduling template's primary skill is scheduling. A research template's primary skill is research.

Secondary skills are supporting capabilities. A scheduling template might use email as a secondary skill to send invitations. The primary skill determines routing. Secondary skills determine what else the agent might need.

Both primary and secondary skills must be enabled on the account for the template to execute. If a required skill isn't enabled, the task will fail.

Task Configuration

The taskConfig object controls execution behavior:

FieldTypeDescription
prioritystringExecution priority (low, normal, high, urgent)
timeoutMinutesnumberMaximum execution time before the task is killed
retryOnFailurebooleanWhether to retry automatically on failure
maxRetriesnumberMaximum retry attempts (if retries are enabled)

These are defaults. They can be overridden at runtime when creating a task from the template.

Variables

Variables are the template's input contract. Each variable has a name, type, description, whether it's required, and an optional default value.

At runtime, you provide values for the required variables (and optionally override defaults). The agent uses these values to execute the workflow.

Variable types follow JSON conventions: string, number, boolean, array, object.

API Reference

Endpoints

MethodPathDescriptionAuth
GET/task-templatesList task templatesManagement
GET/task-templates/:templateIdGet template detailsManagement

Admin Endpoints (Super-Admin Only)

MethodPathDescription
POST/admin/task-templatesCreate a task template
PUT/admin/task-templates/:templateIdUpdate a task template
DELETE/admin/task-templates/:templateIdDelete a task template

Template Object

json
{
  "id": "tmpl_schedule_meeting",
  "displayTitle": "Schedule a Meeting",
  "description": "Coordinate a meeting between two or more participants with automatic availability checking.",
  "primarySkillId": "skill_scheduling",
  "secondarySkillIds": ["skill_email"],
  "taskConfig": {
    "priority": "normal",
    "timeoutMinutes": 30,
    "retryOnFailure": true,
    "maxRetries": 2
  },
  "variables": [
    {
      "name": "participants",
      "type": "array",
      "description": "Email addresses of meeting participants",
      "required": true
    },
    {
      "name": "duration",
      "type": "number",
      "description": "Meeting duration in minutes",
      "required": true,
      "default": 30
    },
    {
      "name": "title",
      "type": "string",
      "description": "Meeting title",
      "required": true
    },
    {
      "name": "notes",
      "type": "string",
      "description": "Additional context or agenda items",
      "required": false
    }
  ],
  "createdAt": "2026-01-20T14:00:00.000Z"
}
FieldTypeDescription
idstringUnique template identifier
displayTitlestringHuman-readable title
descriptionstringWhat this template does
primarySkillIdstringPrimary skill ID
secondarySkillIdsstring[]Secondary skill IDs
taskConfigobjectDefault execution configuration
taskConfig.prioritystringlow, normal, high, or urgent
taskConfig.timeoutMinutesnumberMax execution time in minutes
taskConfig.retryOnFailurebooleanAuto-retry on failure
taskConfig.maxRetriesnumberMax retry count
variablesobject[]Input variable definitions
variables[].namestringVariable name
variables[].typestringstring, number, boolean, array, or object
variables[].descriptionstringWhat this variable is for
variables[].requiredbooleanWhether the variable must be provided
variables[].defaultanyDefault value if not provided
createdAtstringISO 8601 timestamp

List Templates

bash
curl https://api.agnt.ai/task-templates \
  -H "Authorization: Bearer $TOKEN"

Filter by skill:

bash
curl "https://api.agnt.ai/task-templates?skillId=skill_scheduling" \
  -H "Authorization: Bearer $TOKEN"
json
{
  "success": true,
  "data": [
    {
      "id": "tmpl_schedule_meeting",
      "displayTitle": "Schedule a Meeting",
      "description": "Coordinate a meeting between two or more participants.",
      "primarySkillId": "skill_scheduling",
      "secondarySkillIds": ["skill_email"],
      "taskConfig": {
        "priority": "normal",
        "timeoutMinutes": 30,
        "retryOnFailure": true,
        "maxRetries": 2
      },
      "variables": [
        { "name": "participants", "type": "array", "required": true },
        { "name": "duration", "type": "number", "required": true, "default": 30 },
        { "name": "title", "type": "string", "required": true },
        { "name": "notes", "type": "string", "required": false }
      ],
      "createdAt": "2026-01-20T14:00:00.000Z"
    },
    {
      "id": "tmpl_reschedule",
      "displayTitle": "Reschedule a Meeting",
      "description": "Find a new time for an existing meeting.",
      "primarySkillId": "skill_scheduling",
      "secondarySkillIds": ["skill_email", "skill_calendar"],
      "taskConfig": {
        "priority": "high",
        "timeoutMinutes": 15,
        "retryOnFailure": true,
        "maxRetries": 3
      },
      "variables": [
        { "name": "meetingId", "type": "string", "required": true },
        { "name": "reason", "type": "string", "required": false },
        { "name": "preferredTimes", "type": "array", "required": false }
      ],
      "createdAt": "2026-01-22T09:30:00.000Z"
    }
  ]
}

Create a Template (Admin)

bash
curl -X POST https://api.agnt.ai/admin/task-templates \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "displayTitle": "Send Follow-Up Email",
    "description": "Draft and send a follow-up email after a meeting, summarizing key points and action items.",
    "primarySkillId": "skill_email",
    "secondarySkillIds": ["skill_writing"],
    "taskConfig": {
      "priority": "normal",
      "timeoutMinutes": 10,
      "retryOnFailure": false,
      "maxRetries": 0
    },
    "variables": [
      {
        "name": "meetingId",
        "type": "string",
        "description": "ID of the meeting to follow up on",
        "required": true
      },
      {
        "name": "recipients",
        "type": "array",
        "description": "Email addresses to send the follow-up to",
        "required": true
      },
      {
        "name": "tone",
        "type": "string",
        "description": "Desired tone: formal, casual, or brief",
        "required": false,
        "default": "formal"
      }
    ]
  }'
json
{
  "success": true,
  "data": {
    "id": "tmpl_follow_up_email",
    "displayTitle": "Send Follow-Up Email",
    "description": "Draft and send a follow-up email after a meeting, summarizing key points and action items.",
    "primarySkillId": "skill_email",
    "secondarySkillIds": ["skill_writing"],
    "taskConfig": {
      "priority": "normal",
      "timeoutMinutes": 10,
      "retryOnFailure": false,
      "maxRetries": 0
    },
    "variables": [
      {
        "name": "meetingId",
        "type": "string",
        "description": "ID of the meeting to follow up on",
        "required": true
      },
      {
        "name": "recipients",
        "type": "array",
        "description": "Email addresses to send the follow-up to",
        "required": true
      },
      {
        "name": "tone",
        "type": "string",
        "description": "Desired tone: formal, casual, or brief",
        "required": false,
        "default": "formal"
      }
    ],
    "createdAt": "2026-03-01T12:00:00.000Z"
  }
}

Update a Template (Admin)

bash
curl -X PUT https://api.agnt.ai/admin/task-templates/tmpl_follow_up_email \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "taskConfig": {
      "priority": "normal",
      "timeoutMinutes": 15,
      "retryOnFailure": true,
      "maxRetries": 1
    }
  }'

Delete a Template (Admin)

bash
curl -X DELETE https://api.agnt.ai/admin/task-templates/tmpl_follow_up_email \
  -H "Authorization: Bearer $TOKEN"
json
{
  "success": true,
  "data": {
    "deleted": true
  }
}

For Coding Agents

  • Fetch templates before creating tasks. Call GET /task-templates to discover available workflows. Match user intent to the right template instead of building task configurations from scratch.
  • Validate variables client-side. The template defines the variable contract — names, types, required flags. Validate inputs before sending the task creation request. Fail fast with a clear message if a required variable is missing.
  • Use skillId filtering to narrow results. If you already know which skill the user needs, filter templates by skillId to avoid parsing the full list.
  • Respect defaults. If a variable has a default value and the user didn't specify one, use the default. Don't prompt for values that have sensible defaults.
  • Check skill availability. A template requires both its primary and secondary skills to be enabled. Before offering a template to a user, verify the required skills are active on the account via GET /skills.
  • taskConfig values are defaults, not absolutes. If the user specifies urgency or a different timeout, override the template's defaults at task creation time.

For Product Teams

  • Templates standardize agent behavior. Instead of letting agents interpret freeform requests differently each time, templates guarantee a consistent approach. Same inputs, same process, same quality.
  • Separate design from execution. Your operations team designs the templates. Your users (or their agents) trigger them. This lets you control quality without bottlenecking every request.
  • Filter by skill for contextual UI. When a user is working within a specific skill context (say, scheduling), show them only the templates relevant to that skill. The skillId query parameter makes this a single API call.
  • Variables are your input forms. Each template's variable list maps directly to a form. Name, type, required, description, default — everything you need to render an input UI without guessing.
  • Admin endpoints control the catalog. Creating, updating, and deleting templates is a super-admin operation. Account users consume templates — they don't define them. This keeps the template library curated and consistent.
  • Task config defaults reduce decision fatigue. Users don't need to think about timeouts and retry behavior unless they want to. The template handles it. Power users can override.