Video: Setting up Kestra
Here's how to set up everything you need to run the example flows in this module.
This module requires Docker with Docker Compose to run Kestra locally. Docker Desktop is the easiest way to get both on Mac and Windows. If you don't have Docker installed, set that up before proceeding.
This module includes a docker-compose.yml with Kestra pre-configured:
cd 03-orchestration
docker compose up -d
Once the container starts, access the Kestra UI at http://localhost:8080.
To shut down Kestra:
docker compose down
Gemini API Key (Required)
The free tier is sufficient for light use, but rate limits are relatively low — you may hit quota quickly if you run the agent and multi-agent flows repeatedly. If you run into 429 Resource Exhausted errors, wait a minute before retrying, or consider upgrading to a paid tier.
OpenAI API Key (Required for flow 3)
Tavily API Key (Required for web search: flows 3, 5, and 6)
The free tier includes 1,000 searches/month.
Kestra reads secrets from environment variables prefixed with SECRET_ where the value is base64-encoded. Export your keys before starting Kestra:
export GEMINI_API_KEY="your-gemini-api-key-here" # required
export SECRET_GEMINI_API_KEY=$(echo -n $GEMINI_API_KEY | base64) # required
export SECRET_OPENAI_API_KEY=$(echo -n "your-openai-api-key-here" | base64) # required for flow 3
export SECRET_TAVILY_API_KEY=$(echo -n "your-tavily-api-key-here" | base64) # optional
Then start (or restart) Kestra:
docker compose up -d
In flows, reference secrets with {{ secret('GEMINI_API_KEY') }} — omit the SECRET_ prefix when calling secret().
[!WARNING] Never commit API keys to Git!
cd 03-orchestration
# Adjust username and password to match your Kestra setup
curl -X POST -u 'admin@kestra.io:Admin1234!' http://localhost:8080/api/v1/flows/import -F fileUpload=@flows/1_chat_without_rag.yaml
curl -X POST -u 'admin@kestra.io:Admin1234!' http://localhost:8080/api/v1/flows/import -F fileUpload=@flows/2_chat_with_rag.yaml
curl -X POST -u 'admin@kestra.io:Admin1234!' http://localhost:8080/api/v1/flows/import -F fileUpload=@flows/3_rag_with_websearch.yaml
curl -X POST -u 'admin@kestra.io:Admin1234!' http://localhost:8080/api/v1/flows/import -F fileUpload=@flows/4_simple_agent.yaml
curl -X POST -u 'admin@kestra.io:Admin1234!' http://localhost:8080/api/v1/flows/import -F fileUpload=@flows/5_web_research_agent.yaml
curl -X POST -u 'admin@kestra.io:Admin1234!' http://localhost:8080/api/v1/flows/import -F fileUpload=@flows/6_multi_agent_research.yaml
Alternatively, copy-paste the flow YAML directly into Kestra's UI.
zoomcamp namespace4_simple_agent flow and click "Execute"5_web_research_agent and 6_multi_agent_research and analyze the logs and outputsTry the following experiment:
After trying the same prompt in ChatGPT vs Kestra's AI Copilot, what is the primary reason AI Copilot generates better Kestra flows?
Run both 1_chat_without_rag.yaml and 2_chat_with_rag.yaml in the Kestra UI. Read the execution logs for each.
The non-RAG response about Kestra 1.1 features is best described as:
Run 4_simple_agent.yaml with summary_length = short (leave the other inputs as defaults).
Open the execution logs and find the token usage logged by the log_token_usage task.
What is the approximate output token count for multilingual_agent?
Run 4_simple_agent.yaml again with summary_length = long.
Compare the multilingual_agent output token count to your result from Question 3. Roughly how many times more output tokens does the long summary use?
Open 4_simple_agent.yaml in the Kestra flow editor. Find the english_brevity task and change its prompt from asking for exactly 1 sentence to asking for exactly 3 sentences.
Save the flow, then run it with summary_length = long.
Compare the english_brevity output token count to the original 1-sentence version (also with summary_length = long). How do they compare?
Based on what you learned in this module, for production workflows requiring deterministic, repeatable results with strict compliance requirements (e.g., financial reporting, workflows in highly regulated industries), which approach is most appropriate?