Unit 2/Lesson 2 of 3

Data Flow, Reliability Primitives & the Plugin System

How data moves between tasks (outputs, inputs, the KV store), how Kestra handles failure (retries, timeouts, error handlers, SLAs), and how the plugin ecosystem works — 1300+ plugins, all JAR-based, versioned independently from the core platform.

SkillsData flowReliabilityPlugin architecture
+25 XP
✏️ On desktop — select text to ask Nobi, save notes, or add thoughts

Data flow between tasks

Task outputs and Pebble expressions:
When a task completes, its outputs are accessible to subsequent tasks via Pebble template expressions:

```yaml
tasks:
- id: fetch_data
type: io.kestra.plugin.http.Request
uri: https://api.example.com/data

- id: process
type: io.kestra.plugin.core.log.Log
message: "Got {{ outputs.fetch_data.body }}"
```

Pebble is Kestra's templating engine — a Java implementation of Jinja2-style expressions. It evaluates {{ }} expressions at runtime, providing access to: task outputs, flow inputs, execution metadata, environment variables, secrets, and KV store values. Every dynamic value in a Kestra flow goes through Pebble.

Internal storage for large outputs:
When tasks produce large data (a CSV file, a JSON response with thousands of records), Kestra stores them in internal storage (backed by local filesystem, S3, GCS, or Azure Blob) rather than in memory. Subsequent tasks reference these stored artifacts by URI. This is what makes Kestra work for data-heavy workflows without running out of memory.

The KV Store:
Kestra's built-in Key-Value store provides state persistence across multiple flow executions. A flow run on Monday can write a value to the KV store; a flow run on Tuesday can read it. This is how Kestra handles stateful orchestration patterns: "only process records created after the last successful run" or "track which items have been processed to avoid duplicates."

囲
Ajiあじ

Latent potential — possibilities that remain in a position even after it seems settled. Task outputs are aji: they create potential in the flow that can be activated by subsequent tasks in ways not determined at flow design time.

Reliability primitives

Retries:
Configured per task or at the flow level. Three strategies:
- Constant: retry after a fixed delay (e.g., retry every 30 seconds, up to 5 times)
- Exponential: retry with increasing delays (e.g., 1s → 2s → 4s → 8s) — appropriate for rate-limited APIs
- Random: retry with a random delay within a range — useful for reducing thundering herd effects

Timeouts:
Set maximum execution duration at the task level (timeout: PT30M) or the flow level. A task that runs longer than its timeout is killed and fails. Combined with retries, timeouts prevent a single hung task from blocking the entire workflow indefinitely.

Error handling:
Kestra has two error handling layers:
- Task-level: an errors block inside a task defines what to run if that specific task fails
- Flow-level: a global errors block defines what to run if any task in the flow fails (send an alert, log the failure, trigger a remediation flow)

SLAs (Service Level Agreements):
New in Kestra 1.0. Define expected execution duration (maxDuration: PT2H) and Kestra automatically takes actions if the SLA is breached: kill the execution, send an alert, or trigger another flow. This turns "hope this runs in under 2 hours" into "automatically handle it if it doesn't."

Subflows:
A task that calls another flow as a step. Enables modularity: a complex workflow is broken into smaller, reusable flows that are composed via subflow tasks. Subflows run as separate executions, so they have their own observability and can be triggered independently for testing.

The plugin system: 1300+ integrations

How plugins work:
Each Kestra plugin is a Java JAR file that implements the plugin API. Plugins define new task types (runnable and flowable), new trigger types, and new condition types. They're distributed via Maven repositories and installed into a Kestra instance without restarting the server.

Plugin versioning (new in 1.0):
Before 1.0, all plugins had to be the same version as the Kestra server. This meant upgrading one plugin required upgrading all plugins — a risky operation for large deployments. Plugin versioning allows different plugin versions to coexist, enabling gradual migration: upgrade the Kafka plugin independently of the S3 plugin without touching the others.

What 1300+ plugins means:
The plugin catalog covers:
- Cloud providers: AWS (S3, Lambda, RDS, Glue, SageMaker, Redshift...), GCP (BigQuery, GCS, Dataflow...), Azure (Blob Storage, Data Factory...)
- Data systems: Snowflake, Databricks, dbt, Fivetran, Kafka, Elasticsearch, MongoDB, PostgreSQL, MySQL...
- DevOps: Docker, Kubernetes, Terraform, Ansible, Helm...
- Communication: Slack, PagerDuty, email, GitHub, Jira...
- AI/LLM: Anthropic (Claude), OpenAI, Google AI — and the AI Agent plugin
- Scripting: Python, R, Node.js, Go, Bash, PowerShell

The open-source plugin contribution model:
Most plugins are open source and community-maintained. Kestra curates the official plugin library and maintains a core set of plugins. The breadth of the ecosystem is a network-effects moat: more plugins → more use cases covered → more users → more plugin contributions.

Ask Nobiexplain

Select any text in the lesson to ask a question. Press Esc to close.

1 / 2

A data pipeline runs every night and needs to only process records created since the last successful run. How does Kestra support this stateful pattern?