Best Practices

Best practices for building reliable workflows in Kestra, including guidance on choosing the right patterns for common design decisions.

Apply best practices for Kestra workflows

Kestra often provides multiple ways to achieve the same outcome. This section helps you choose the approach that best fits your use case, with guidance on design decisions, implementation patterns, and tradeoffs.

Flow Best Practices

Design Kestra flows for optimal performance and reliability by managing task count, data volume, and parallelism.

Dev to Prod

Recommended patterns for promoting Kestra flows from development to production environments using Git and CI/CD.

Sensitive and Shared Values

Learn how to choose between Kestra credentials, secrets, and the KV Store for authentication, sensitive values, and runtime state.

ForEach vs ForEachItem

Learn when to use ForEach or ForEachItem in Kestra, how they scale differently, and how to access their outputs correctly in downstream tasks.

Purging Data

Learn how to choose the right purge strategy in Kestra for executions, logs, key-value pairs, Namespace files, assets, and other retained data.

Fetch Patterns

Learn when to use Download, HTTP Request, or script-based fetching in Kestra, and how to choose the right pattern for files, APIs, and custom integrations.

Naming Conventions

Learn the best practices for naming namespaces, flows, tasks, and other identifiers in Kestra for a clean and scalable hierarchy.

Manage Environments

Best practices for managing Kestra environments, including separate instances for development and production, and using tenants.

pip Dependencies

Efficiently manage Python pip dependencies in Kestra using custom Docker images, server startup installs, or caching.

Expressions with Namespace Files

Learn how to pass Kestra expressions to scripts stored in Namespace Files using environment variables or CLI arguments.

Git Version Control

Best practices for using Git with Kestra for version control, including SyncFlows, PushFlows, and CI/CD integration.

Flow Outputs

Best practices for managing flow outputs in Kestra, including purging large files and handling conditional outputs efficiently.

Business Unit Separation

Strategies for isolating business units in Kestra Enterprise using Tenants and Namespaces for security and governance.

Secrets

Best practices for securely managing and using secrets in Kestra workflows to prevent accidental exposure.

Was this page helpful?