Prompt Template
The prompt template is a markdown file that defines the task for the agent. It uses Jinja2 syntax to inject data from the trigger task into the prompt.
Basic Template
The simplest template passes the task payload directly to the agent:
You received a support request from {{ trigger_task.payload.customer_name }}.
Their message: {{ trigger_task.payload.message }}
Please categorize this request and draft a response.
Template Variables
The following variables are available inside the template:
| Variable | Description |
|---|---|
trigger_task | The task that triggered the agent |
trigger_task.type | The task type (string) |
trigger_task.payload | The task payload (dictionary) |
Access payload fields with dot notation:
Order ID: {{ trigger_task.payload.order_id }}
Customer: {{ trigger_task.payload.customer.name }}
Items: {{ trigger_task.payload.items }}
Jinja2 Features
You can use Jinja2 control structures to build dynamic prompts:
Review the following order:
- Customer: {{ trigger_task.payload.customer_name }}
- Total: {{ trigger_task.payload.total }}
{% if trigger_task.payload.total > 1000 %}
This is a high-value order. Pay extra attention to fraud signals.
{% endif %}
Items:
{% for item in trigger_task.payload.items %}
- {{ item.name }} ({{ item.quantity }}x)
{% endfor %}
Images
If the task payload contains base64-encoded images in markdown format, they are automatically extracted and sent to the LLM as visual content. The agent can see and analyze these images directly — no special tool is needed.
The user submitted this document:
{{ trigger_task.payload.document_image }}
Extract the text from the image and summarize the key points.
Images must be in markdown format: . The agent receives them as multimodal content and can describe, read text from, or analyze them.
Tips
- Be specific about what the agent should do and what tools to use
- Include relevant context from the task payload
- Mention the expected output format if it matters
- If the agent has
send_task_*tools, remind it to forward results before finishing