Most developers begin their automation journey similarly. They create a script that performs a helpful task, such as pulling data from an API, resizing a batch of images, or emailing a report, and then schedule it to run each morning.

This leads them to add a line to their crontab, which gives them a sense of control. Now, their computer runs the script automatically while they sleep.

For a while, that's enough. Then it isn't.

Maybe the backup script failed silently at 3 a.m., and you didn't find out until you needed it later that day, or you developed the perfect script that ran smoothly in your terminal to find it failing when scheduled in cron.

If any of that sounds familiar, congratulations: you've outgrown cron. You're not alone, and this article aims to help you feel understood and ready for better solutions.

This article is about what comes next. We'll look at exactly where cron runs out of road, what 'workflow orchestration' actually means underneath the buzzword, and then build a real workflow step by step so the concepts stick.

By the end, you'll feel more confident and empowered to choose the right tools for complex scheduling challenges.

What Cron is, and What it's Genuinely Good at

Cron is the system background service (daemon) that runs scheduled tasks. Crontab (cron table) is the configuration file or command utility used to write and manage those task schedules' time-based job scheduler that has shipped with Unix-like systems since the 1970s. It's available on today’s Linux distributions as well as on Macs.

With cron, you specify a schedule and a command, and it runs the command at that time. The schedule uses the famous five-field syntax:

┌───────────── minute (0–59)
│ ┌───────────── hour (0–23)
│ │ ┌───────────── day of month (1–31)
│ │ │ ┌───────────── month (1–12)
│ │ │ │ ┌───────────── day of week (0–6)
│ │ │ │ │
0  9  *  1 5  /usr/bin/python3 /home/me/daily_report.py

Note: The line 0 9 * 1 5  /usr/bin/python3 /home/me/daily_report.py means "run daily_report.py at 9:00 a.m. on weekdays." The syntax is terse, ubiquitous, and (credit where it's due) rock-solid for what it does.

And here's the important part: cron is not bad. For a single, self-contained, failure-tolerant task on one machine, it's the right tool. But for more complex workflows, a purpose-built orchestration tool can provide the reliability and visibility you need, helping you feel more in control of your automation.

The Four Walls You'll Hit with Cron

The trouble with cron starts when your automation stops being a single self-contained task. As your scripts grow, they form more complex systems where you run into the same four limitations, more or less in this order.

Wall 1: Dependencies Between Steps

Your morning routine grows from one script into three. Consider an ETL scenario with three scripts:

  1. extract.py pulls yesterday's orders from an API.

  2. transform.py cleans the data and computes totals.

  3. load.py writes the result into the analytics database.

Each step depends on the one before it. The obvious cron approach is to guess at the timing:

0 2 * * *  python extract.py
0 3 * * *  python transform.py
0 4 * * *  python load.py

You're now hoping the extract finishes within an hour, so that the transform has something to work with. On the day the API is slow, and extract takes 70 minutes, transform runs against stale or missing data and quietly produces garbage. Cron has no concept of "run B only after A succeeds." It only knows wall-clock time.

Wall 2: Failure Handling and Retries

Networks blip. APIs return 503 status codes (Service Unavailable). Databases drop connections. A robust job needs to detect a failure and retry. Maybe three times, or with increasing delays between attempts, so you don't hammer a struggling service.

With cron, retry logic is your problem. You end up bolting it onto every script by hand: try/except blocks, sleep calls, a counter, and a flag file so the next cron tick knows whether the previous one finished. Multiply that across a dozen jobs, and you've written a small, buggy, undocumented orchestration engine.

Wall 3: Visibility

Ask yourself, did your jobs run last night? Which ones succeeded? How long did each take? Is the slowdown in the extract step or the load step?

With cron, the honest answer is "I'd have to go read some log files, if the script even wrote any." The first task is finding the cron job log files themselves.

Finding them can be complicated: cron's logs can be in /var/log/syslog on one system and /var/log/cron on another, assuming logging is enabled. Meanwhile, your script's output only exists if you explicitly redirect stdout and stderr. As a result, you have to search through system logs to verify the job ran, then locate any separate output files that captured its print statements.

When a job fails, identifying the issue is even harder, as you must sift through interleaved logs from multiple runs, trying to determine which timestamp corresponds to the last execution and where it went wrong, often relying only on a non-zero exit code as a clue. There's no dashboard, no run history, no record of how long things took, and no alert when something breaks.

Failures are silent by default, the single most dangerous property a background job can have. You find out your pipeline has been broken for a week when someone downstream notices the numbers stopped updating.

Wall 4: Backfills and Re-runs

Your analytics database has been live for two months when you discover a bug in transform.py that miscalculated totals. You've fixed the code. Now you need to rerun the pipeline for each day in those two months, processing its own slice of data.

This is a backfill, and with cron, it's a nightmare. Cron only ever runs "now." There's no built-in notion of "run this job as if it were March 14th, then March 15th, then..." So you write yet another throwaway script with a date loop, pray it's idempotent, and babysit it.

Notice the pattern across all four walls: each time, you end up reimplementing something poorly that a category of tools already solves well. That category is workflow orchestration.

Can Workflow Orchestration Save the Day?

A workflow orchestrator manages workflows, which are sets of tasks with specific relationships, triggers, and failure protocols, along with observability for tracking outcomes.

While many solutions like Airflow, Dagster, Prefect, and Temporal are available, we'll focus on Kestra, an open-source orchestrator. Kestra stands out from the pack by enabling developers to run, monitor, and manage workflows all from a single declarative layer compatible with any programming language and infrastructure, including public, private, or even air-gapped networks.

Kestra also provides enterprises with the control needed to ensure insights and regulatory compliance. With over 1,600 connectors available, you can build almost any data, infrastructure, or AI workflow you can imagine.

In this tutorial, we'll continue with the cron scheduler theme and build a simple ETL workflow that uses a cron-like schedule while addressing some of cron's shortcomings, such as execution sequence and error handling.

Kestra Primer

Kestra was born out of the engineering pain of creating Python code to achieve proper workflow orchestration. Rather than spend engineering hours crafting the right Python code for your Apache Airflow DAG, with Kestra, your workflow is a YAML file. Simply describe what should run in plain, declarative syntax. Store the file in Git, and deploy it like any other code.

There's no obscure UI logic building and no hidden state management. Just simple text that can be easily reviewed and diffed. The workflow you read is the workflow that runs.

The example YAML file in Figure 1 illustrates a scenario in which you want to move NoSQL data into an analytics-ready warehouse.

id: cassandra-to-bigquery
namespace: company.team

tasks:
  - id: query_cassandra
    type: io.kestra.plugin.cassandra.Query
    session:
      endpoints:
        - hostname: localhost
          port: 9042
      localDatacenter: datacenter1
    cql: |
      SELECT salary_id, work_year, experience_level, employment_type,
      job_title, salary, salary_currency, salary_in_usd, employee_residence,
      remote_ratio, company_location, company_size
      FROM test.salary
    fetchType: STORE

  - id: write_to_csv
    type: io.kestra.plugin.serdes.csv.IonToCsv
    from: "{{ outputs.query_cassandra.uri }}"

  - id: load_bigquery
    type: io.kestra.plugin.gcp.bigquery.Load
    from: "{{ outputs.write_to_csv.uri }}"
    destinationTable: my_project.my_dataset.my_table
    serviceAccount: "{{ secret('GCP_SERVICE_ACCOUNT_JSON') }}"
    projectId: my_project
    format: CSV
    csvOptions:
      fieldDelimiter: ","
      skipLeadingRows: 1

Figure 1: Cassandra to BigQuery Example

Without even knowing much about Kestra, the YAML file is simple and self-explanatory. Later in this post, we'll create a basic ETL flow and explain the significance of fields such as id and type. But first, let’s get an instance of Kestra running on your local machine.

How to Set Up Kestra

Kestra is available as an open-source platform licensed under the Apache 2.0 license as well as an Enterprise offering additional features and product support. In this tutorial, we'll use Docker to run Kestra locally using the latest version.

To spin up Kestra, run the following Docker command:

docker run --pull=always --rm -it -p 8080:8080 
  --user=root \
  --name kestra \
  -v kestra_data:/app/storage \
  -v kestra_db:/app/data \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -v /tmp:/tmp \
  kestra/kestra:latest server local

For other platforms such as Windows and Linux check out https://kestra.io/get-started.

Once the containers are loaded, navigate to the Kestra UI at http://localhost:8080. The welcome screen will ask you to create an administrator. Create the user and finish the initial launch wizard.

Once that's complete, navigate to the Flows tab in the left panel, then click the Create button at the top right of the page. This will create a new flow using a sample template, as shown in the following figure:

Kestra Flows showing Flow Code Editor

Figure 2: Flows page showing the new flow template

Flows in Kestra

In Kestra you define your workflow orchestration through Flows. You can create these Flows using YAML syntax in the UI, through a no-code editor in the UI, or programmatically through an API. In this tutorial, we'll create flows using YAML.

In Figure 2 above, you'll notice that a sample flow is already created to get you started.

The _id, namespace, and tasks are three required fields and are used to identify the flow within the Kestra environment and the task the flow should execute. Each flow lives in one namespace. Namespaces are like folders in a filesystem and are used to group flows and provide structure. Note that you can't change a flow’s namespace after creation.

How to Use Kestra

Step 1: A Simple Task Executed on a Schedule

Let's start by erasing the sample flow provided and replacing it with the following:

id: morning_report
namespace: tutorial

tasks:
  - id: say_hello
    type: io.kestra.plugin.core.log.Log
    message: "Good morning — the pipeline ran at {{ execution.startDate }}"

This example has the required id, namespace, and has one tasks field that logs a message. The message displayed uses a pebble expression (the command inside the  {{ }} brackets) to show the startDate of the execution.

Pebble expressions are used to set values dynamically in flows. In this example, the start date of the execution will be inserted within the string.

To execute this flow, we need to first save it by clicking the Save button in the upper-right corner of the page. Once saved, click the Play button. You'll then be presented with the execute options page, as shown in Figure 3 below:

Execute Flow input dialog

Figure 3: Execute flow options

If this workflow had inputs such as a filename or URL, you can manually enter them here to test your flow. The modal also provides the curl command if you’d like to run the flow via the API instead of the UI. Click the Execute button to run the flow:

Flow execution log dialog

Figure 4: Flow execution log

The flow was simple and wrote the info message to the log file. If the flow had errors or warnings, you'd be able to see detailed execution logs on this page.

Now that we’ve created our first task, let’s schedule it with a cron mask. Add the following to the flow by clicking on the “Edit Flow” button at the top of the page.

Next, add the triggers section to the flow:

triggers:
  - id: every_minute
    type: io.kestra.plugin.core.trigger.Schedule
    cron: "* * * * *"

Execute the flow.  After a few minutes, check out the execution history by clicking on the “Execution” tab on the left side navbar.

Flow execution page

Figure 5: Flow execution page

Our flow now behaves similarly to a single task cron job. The flow has a triggers block with a Schedule trigger whose cron field is the exact same five-field syntax you already know. That last point matters: you're not throwing away what you learned. You're wrapping it in something that can grow as your needs change.

Notice that even in this simple Kestra example, you’ve gained something cron didn't offer. Every time this runs, it's recorded as an execution with a timestamp, a duration, and a status, and all logs are visible in the UI. That's Wall 3 (visibility) handled before we've even done anything interesting.

Step 2: Real Work, and a Dependency

Now let's replace the simple task with the three-step extract/transform/load and have the orchestrator enforce the ordering rather than timing offsets.

id: csv_to_parquet
namespace: company.team
description: Download orders CSV, transform it with a Python script, and write the result to a Parquet file.

tasks:
  # Download a public CSV file into Kestra's internal storage
  - id: download_csv
    type: io.kestra.plugin.core.http.Download
    uri: https://huggingface.co/datasets/kestra/datasets/raw/main/csv/orders.csv

  # Transform the CSV with a simple Python script and write it out as Parquet
  - id: transform_to_parquet
    type: io.kestra.plugin.scripts.python.Script
    containerImage: ghcr.io/kestra-io/pydata:latest
    inputFiles:
      input.csv: "{{ outputs.download_csv.uri }}"
    outputFiles:
      - orders.parquet
    script: |
      import pandas as pd

      # Read the downloaded CSV
      df = pd.read_csv("input.csv")

      # --- simple transformation ---
      # Ensure numeric types and add a computed column
      df["total"] = df["quantity"] * df["price"]

      # Keep only orders above a small threshold as an example filter
      df = df[df["total"] > 0]

      print(f"Rows after transform: {len(df)}")

      # Write the result to Parquet
      df.to_parquet("orders.parquet", index=False)

  # Log that the Parquet file was produced
  - id: log_output
    type: io.kestra.plugin.core.log.Log
    message: "Parquet file created: {{ outputs.transform_to_parquet.outputFiles['orders.parquet'] }}"
# Expose the Parquet file as a downloadable flow output.
# FILE-typed flow outputs appear on the execution's Overview tab with a download button.
outputs:
  - id: parquet_file
    type: FILE
    value: "{{ outputs.transform_to_parquet.outputFiles['orders.parquet'] }}"

Save the flow, then execute.

Execution results

Figure 6: Execution results

Two things just happened. First, tasks listed in sequence run in sequence. Transform_to_parquet only starts after download_csv succeeds, and log_output only after transform_to_parquet succeeds. If a failure occurs, the execution stops, and transform_to_parquet never touches stale data. That's Wall 1 (dependencies) gone, with no guesswork about timing.

Second, notice the expression within the flow {{ outputs.download_csv.uri }}. Tasks can pass data and metadata to subsequent tasks using expressions like this. That wiring turns a list of scripts into an actual pipeline.

Step 3: Surviving Failure with Retries

Now consider the scenario where the download_csv task encounters a network issue, and the flow is unable to download the latest data. Let's make that task resilient declaratively by adding a retry section to the download_csv task:

- id: download_csv
    type: io.kestra.plugin.core.http.Download
    uri: https://huggingface.co/datasets/kestra/datasets/raw/main/csv/orders.csv
    retry:
      type: constant
      maxAttempts: 5
      interval: PT10S

That's the whole retry policy. If the download fails, Kestra waits and tries again up to 5 times, with a 10-second delay (PT10S is ISO-8601 for "10 seconds"). There are no counters, sleep calls, or flag files. Wall 2 (failure handling) is handled in 3 lines that read like a sentence.

To test this, drop the “s” from orders.csv and rerun the flow. You can see the execution showing retrying.

Execution dialog showing retry

Figure 7: Execution showing retry

If all attempts fail, you'll probably want to be notified. Let’s add a flow-level error handler that runs only when something in the workflow fails:

errors:
  - id: notify_failure
    type: io.kestra.plugin.notifications.slack.SlackIncomingWebhook
    url: "{{ secret('SLACK_WEBHOOK') }}"
    payload: |
      {"text": "orders_pipeline failed on execution {{ execution.id }}"}

Now a broken pipeline pings a Slack channel instead of failing silently at 3 a.m. Note that secrets are protected within flows via the secret expression.

Step 4: Triggering on Events, Not Just Time

Schedules are only one kind of trigger. Suppose orders don't arrive on a fixed timetable. Instead, a file lands in cloud storage whenever an upstream system feels like it.

Polling on a cron schedule ("check every 5 minutes, exit if nothing's there") is wasteful and laggy. Event triggers are the better model: run the workflow when the thing happens.

Conceptually, instead of adding a scheduled trigger similar to the one added in the previous example:

triggers:
  - id: every_minute
    type: io.kestra.plugin.core.trigger.Schedule
    cron: "* * * * *"

You can add a trigger that fires when a new object appears in an S3 bucket:

triggers:
  - id: new_s3_object
    type: io.kestra.plugin.aws.s3.Trigger
    interval: "PT1M"
    accessKeyId: "{{ secret('AWS_ACCESS_KEY_ID') }}"
    secretKeyId: "{{ secret('AWS_SECRET_KEY_ID') }}"
    region: "eu-central-1"
    bucket: "my-bucket"
    prefix: "incoming/"
    on: CREATE
    action: NONE

Alternatively, you could have a trigger that exposes a webhook URL you can POST to start execution, or real-time triggers that listen to streaming services such as Kafka queues. In any of these trigger scenarios, the workflow body stays identical. Your automation can now respond to the world rather than just watching the clock.

Step 5: Backfilling the Past

Finally, consider the bug-in-transform scenario. You've fixed the calculation and need to re-run the pipeline for every day of the last two months. This would be painful in cron.

In an orchestrator, a backfill is a first-class operation on a scheduled workflow: you pick a start and end date, and it generates one execution per scheduled interval across that range. Each execution is aware of the date it represents, through an expression like {{ trigger.date }}. Your transform step can use that date to fetch and process the correct slice of data.

This is where idempotency stops being academic. Because a backfill re-runs days you may have already processed, your data load step should write with an "insert or replace" semantic keyed on the date, so running March 14th, for example, twice leaves the database in the same state as running it once.

Design for that and backfills become routine instead of terrifying. Wall 4 (backfills) is handled, but only if you've held up your end with idempotent tasks.

Where to Go Next

The best way to internalize all of this is to take an existing cron job and rebuild it as a proper workflow. Start with the one-task version, confirm it runs and appears in the run history, then add a second dependent task, a retry policy, and a failure alert.

Each step maps to one of the four walls, and you'll feel the difference immediately the first time a task fails, retries itself, and recovers without waking you up.

You don't need to write every line from scratch. Kestra provides a library of Blueprints that are hundreds of ready-made, copy-pasteable flows that you can browse at kestra.io/blueprints or access directly in your instance under the Blueprints tab.

Each Blueprint is a complete, executable example with an explanation of its functionality and how to extend it. This allows you to start with a close version of your goal and modify it rather than guessing at the syntax.

Cron showed that computers can operate while you're asleep. Orchestration takes it further, ensuring they do so reliably, in order, and visibly. This shift transforms the idea from merely writing a script to managing a full system.