Available on: Open Source EditionEnterprise EditionCloud1.0.0
Build AI workflows with your preferred LLM.
Kestra provides plugins for multiple LLM providers and continues to add more with each release. You can design flows that use your chosen model and seamlessly integrate AI into orchestration workflows.
AI workflows
The following examples demonstrate Kestra AI plugins for a variety of workflows. You can adapt each example to your chosen provider. Three key properties are important to understand:
type
: Defines the LLM provider plugin and task (e.g.,ChatCompletion
with OpenAI).apiKey
: Access key for the provider – store this as a key-value pair in Kestra Open Source or as a secret in Enterprise Edition.model
: Specifies the provider model. Models vary in performance, cost, and capabilities, so choose the one that best fits your use case.
Different provider plugins may include additional properties beyond those shown in the examples. Refer to each plugin’s documentation for a complete list. Common properties to be aware of include prompt
, messages
, jsonResponseSchema
, to name a few.
::collapse{title="This flow checks the daily wind conditions in Cambridgeshire and uses Google Gemini to decide whether it is suitable to go sailing. If the wind speed falls within the preferred range (above 10 knots and below 30 knots), the flow notifies you in Slack with the recommendation and automatically blocks your calendar for the day with an "Out of office – gone sailing" event. It runs every morning at 8:00 AM on a schedule."}
id: check_weather
namespace: company.ai
tasks:
- id: ask_ai
type: io.kestra.plugin.gemini.StructuredOutputCompletion
apiKey: "{{ kv('GEMINI_API_KEY') }}"
model: "gemini-2.5-flash-preview-05-20"
prompt: "I like to go sailing when the wind is above 10 knots but below 30 knots. I sail in Cambridgeshire. If the wind is within that range, I want to know if I should go sailing or not. Also tell me the current wind speed speeds"
jsonResponseSchema: |
{
"type": "object",
"properties": {
"content": {
"type": "string"
},
"wind": {
"type": "number"
},
"go_sailing": {
"type": "boolean"
}
}
}
}
- id: if
type: io.kestra.plugin.core.flow.If
condition: "{{ outputs.ask_ai['predictions'] | first | jq('.go_sailing') | first }}"
then:
- id: notify_me
type: io.kestra.plugin.notifications.slack.SlackIncomingWebhook
url: "{{ kv('SLACK_WEBHOOK') }}"
payload: |
{
"text": "{{ outputs.ask_ai['predictions'] | first | jq('.content') | first }}"
}
- id: block_calendar
type: io.kestra.plugin.googleworkspace.calendar.InsertEvent
calendarId: "{{ kv('CALENDAR_ID') }}"
serviceAccount: "{{ kv('GOOGLE_SA') }}"
summary: Out of office
description: "Gone sailing because the wind is {{ outputs.ask_ai['predictions'] | first | jq('.wind') | first }} knots"
startTime:
dateTime: "{{ now() | date(\"yyyy-MM-dd'T'09:00:00+01:00\") }}"
timeZone: "Europe/London"
endTime:
dateTime: "{{ now() | date(\"yyyy-MM-dd'T'18:00:00+01:00\") }}"
timeZone: "Europe/London"
creator:
email: [email protected]
triggers:
- id: check_daily
type: io.kestra.plugin.core.trigger.Schedule
cron: "* 8 * * *"
Was this page helpful?