Back to docs
Configuration

Executors Configuration

Dagy uses **runtime tiers** as the primary user-facing concept for configuring execution environments. Each runtime tier is backed by one of three execution backends: **Lambda**, **Step Functions**, and **ECS Fargate**. These are selected automatically based on your tier choice and flow requirements. The backend router handles the internal infrastructure mapping, ensuring your flows run with the right amount of compute resources.

Runtime Tiers

Dagy provides six runtime tiers designed for different workload characteristics. Each tier automatically selects the appropriate backend infrastructure:

TierDescriptionMax DurationResourcesBest For
nanoAll tasks in one invocation10 minutesShared infrastructureDevelopment, testing, minimal workloads
microEach task runs independently10 minutes per taskShared infrastructureSimple DAGs, short-lived pipelines
smallDedicated computeUnlimited0.5 vCPU / 1 GB RAMSmall workloads, moderate complexity
mediumDedicated computeUnlimited1 vCPU / 2 GB RAMGeneral-purpose workflows
largeDedicated computeUnlimited2 vCPU / 4 GB RAMResource-intensive tasks, long pipelines
xlargeDedicated computeUnlimited4 vCPU / 12 GB RAMHigh-compute workloads, large datasets

Execution Backends (Internal Implementation)

Dagy uses three execution backends internally to support the runtime tiers above. These backends are implementation details managed automatically by the framework and are documented here for infrastructure operators.

Lambda (Default)

Backend for: nano, micro tiers

Executes flows synchronously within the current Lambda invocation using the local executor with ThreadPoolExecutor-based timeouts.

Executes flows synchronously within the current Lambda invocation using the local executor with ThreadPoolExecutor-based timeouts.

PropertyValue
Max duration900 seconds (15 minutes)
Max memory10,240 MB
Parallel tasksNo (sequential execution)
Native retryNo (handled by SDK LocalExecutor)
CancellationYes (checked between tasks)
Cost~$0.06/hr at 1 GB

Best for: Short-lived pipelines, simple DAGs, development/testing.

Lambda is always available as the default backend. No additional configuration is required.

Step Functions

Backend for: Reserved for complex orchestration scenarios (not directly exposed via runtime tiers)

Translates FlowSpec DAGs into Amazon States Language (ASL) state machines with native parallel execution and retry support.

PropertyValue
Max duration1 year (Standard workflows)
Max states25,000
Parallel tasksYes (native Parallel state)
Native retryYes (ASL Retry policies)
CancellationYes (stop_execution())
CostPer state transition

Best for: Long-running pipelines (15 min – 1 hr), complex DAGs with many parallel tasks.

Configuration:

Environment VariableDescriptionRequired
DAGY_SFN_ROLE_ARNIAM role ARN for Step Functions executionYes (enables backend)
DAGY_SFN_TASK_EXECUTOR_ARNLambda ARN that executes individual tasksYes

The Step Functions backend is registered automatically when DAGY_SFN_ROLE_ARN is set.

ASL translation details:

  • Sequential dependencies become Next transitions
  • Independent tasks at the same dependency level become Parallel branches
  • retries maps to ASL Retry with MaxAttempts
  • retry_delay_seconds maps to IntervalSeconds (integer only, fractional seconds are truncated)
  • retry_jitter_factor sets BackoffRate: 2.0 (exponential backoff); without jitter, BackoffRate: 1.0
  • timeout_seconds maps to ASL TimeoutSeconds
  • All errors are caught via Catch blocks that route to a HandleTaskFailure state

Note: List-based and callable delay strategies are not fully translated to ASL. Only the first interval value is used as a fixed IntervalSeconds.

ECS Fargate

Backend for: small, medium, large, xlarge tiers

Runs DAG flows as ECS Fargate tasks for resource-intensive or very long-running workloads.

PropertyValue
Max durationUnlimited
Max memory120 GB
Max vCPU16
Parallel tasksNo (managed by Dagy orchestrator)
Native retryNo (orchestrator handles)
CancellationYes (stop_task())
Streaming logsYes (CloudWatch Logs)
Cost~$0.045/hr at 0.25 vCPU, 0.5 GB

Best for: Long-running workloads (> 1 hr), resource-intensive tasks needing > 10 GB memory.

Configuration:

Environment VariableDescriptionRequired
DAGY_ECS_CLUSTER_ARNECS cluster ARNYes (enables backend)
DAGY_ECS_EXECUTION_ROLE_ARNTask execution role (for pulling images, logs)No
DAGY_ECS_TASK_ROLE_ARNTask role (permissions for your code)No
DAGY_ECS_WORKER_IMAGEDocker image for the workerNo (default: dagy-worker:latest)
DAGY_ECS_SUBNETSComma-separated subnet IDsNo
DAGY_ECS_SECURITY_GROUPSComma-separated security group IDsNo
DAGY_ECS_LOG_GROUPCloudWatch log groupNo (default: /ecs/dagy-worker)

The ECS backend is registered automatically when DAGY_ECS_CLUSTER_ARN is set.

Runtime Tier to Resource Mapping:

Runtime TiervCPUMemory
small0.51 GB
medium12 GB
large24 GB
xlarge412 GB

Valid Fargate CPU/memory combinations (for custom configurations):

vCPUMemory Options
0.25512 MB, 1 GB, 2 GB
0.51–4 GB
12–8 GB
24–16 GB
48–30 GB
816–60 GB
1632–120 GB

Runtime Tier Selection

The runtime tier is determined by a 6-level resolution strategy. The tier you select automatically maps to the appropriate execution backend:

  1. Explicit request: per-run runtime_tier field in the API trigger
  2. Deployment config: default_runtime_tier on the deployment
  3. Environment config: default_runtime_tier on the environment
  4. Flow config: runtime_tier on the @task decorator
  5. Automatic selection rules: based on flow properties
  6. Default: nano

Automatic Tier Selection Rules

When no explicit runtime tier is specified, the router evaluates these rules in priority order:

PriorityRuleConditionSelected Tier
100ResourceMemory ≥ 3 GBxlarge
90DurationMax timeout > 1 hrlarge
80DurationMax timeout 15 min – 1 hrmedium
70ComplexityTask count ≥ 50large
-DefaultEverything elsemicro

Per-Task Runtime Tier

You can specify a preferred runtime tier on individual tasks:

from dagy import task

@task(runtime_tier="large")
def memory_intensive(data: list) -> dict:
    # This task runs on the large tier (2 vCPU / 4 GB RAM)
    ...

The runtime_tier field is a hint; the backend router considers it alongside deployment and environment configuration.

Backend Capabilities Reference

This reference is for infrastructure operators and developers integrating with Dagy's backend systems directly.

CapabilityLambdaStep FunctionsECS Fargate
max_duration_seconds90031,536,000Unlimited
max_memory_mb10,240Depends on compute122,880
max_tasksUnlimited25,000Unlimited
supports_parallelNoYesNo
supports_native_retryNoYesNo
supports_cancelYesYesYes
supports_streaming_logsNoNoYes