AI Copilot in Kestra
Kestra's AI Copilot is specifically designed to generate and modify Kestra flows with full context about the latest plugins, workflow syntax, and best practices.
Copilot’s advantage is contextual assistance: it drafts within Kestra’s flow model while keeping review and execution explicit.
Setup AI Copilot
Before using AI Copilot, you need to configure Gemini API access in your Kestra instance.
Step 1: Get Your Gemini API Key
- Visit Google AI Studio: https://aistudio.google.com/app/apikey
- Sign in with your Google account
- Click "Create API Key"
- Copy the generated key (keep it secure!)
[!WARNING] Never commit API keys to Git. Always use environment variables or Kestra's KV Store.
Step 2: Configure Kestra AI Copilot
Add the following to your Kestra configuration. You can do this by modifying your docker-compose.yml file from 2.2:
services:
kestra:
environment:
KESTRA_CONFIGURATION: |
kestra:
ai:
type: gemini
gemini:
model-name: gemini-2.5-flash
api-key: ${GEMINI_API_KEY}
Then restart Kestra:
cd 02-workflow-orchestration/docker
export GEMINI_API_KEY="your-api-key-here"
docker compose up -d
Exercise: ChatGPT vs AI Copilot Comparison
Objective: Learn why context engineering matters.
- Open Kestra UI at http://localhost:8080
- Create a new flow and open the Code editor panel
- Click the AI Copilot button (sparkle icon ✨) in the top-right corner
- Enter the same exact prompt we used with ChatGPT:
Create a Kestra flow that loads NYC taxi data from a CSV file to BigQuery. The flow should extract data, upload to GCS, and load to BigQuery. - Compare the outputs:
- ✅ Copilot generates executable, working YAML
- ✅ Copilot uses correct plugin types and properties
- ✅ Copilot follows current Kestra best practices
Key Learning: Context matters! AI Copilot has access to current Kestra documentation, generating Kestra flows better than a generic ChatGPT assistant.