Stop a scheduled automation from running twice at once

Adds a simple traffic light so a scheduled task never starts a second time before the first run finishes.

How the work actually flows

It branches. Exactly one path is taken.

Pattern: Exclusive Choice (4) · Simple Merge (5)

flowchart TD trig(["scheduled job interval fires"]):::trigtime s0["check if job running"]:::task s1["run main job"]:::task s2["clear running flag"]:::task trig --> s0 s1 --> s2 gx{"× is job already running"}:::gate s0 --> gx p00["skip this run"]:::task gx -->|"already running"| p00 p10["set flag and continue"]:::task gx -->|"not running"| p10 jn{"○ proceed to run job"}:::gate p00 --> jn p10 --> jn jn --> s1 out[/"no duplicate overlapping runs"/]:::out pay{{"reliable single job execution"}}:::pay s2 --> out out --> pay s1 -. "failures recorded, run continues" .-> out classDef task fill:#e7f6fe,stroke:#34b8f0,color:#2c2a29 classDef svc fill:#f6f8fa,stroke:#7c8795,color:#2c2a29 classDef mi fill:#e7f6fe,stroke:#0079a8,color:#2c2a29,stroke-width:2px classDef human fill:#fff,stroke:#0079a8,color:#0079a8 classDef store fill:#f6f8fa,stroke:#0079a8,color:#2c2a29 classDef trig fill:#00a4eb,stroke:#0079a8,color:#fff,font-weight:bold classDef trigtime fill:#00a4eb,stroke:#0079a8,color:#fff,font-weight:bold classDef trigdata fill:#8ad4f5,stroke:#0079a8,color:#06314c,font-weight:bold classDef gate fill:#fff,stroke:#e8a23d,color:#6b4708,font-weight:bold classDef out fill:#1f9d6b,stroke:#167a53,color:#fff,font-weight:bold classDef pay fill:#06314c,stroke:#021f33,color:#fff
Starts itA stepOne path onlyPaths rejoinResultPayoff
Build size
Standard

A mid-size build with several tools working together.

Business functions
General Automation
Connects
Redis

The problem it solves

When a scheduled job takes longer than expected, a new run can kick off before the last one is done. That overlap can duplicate records, send double notifications, or corrupt data you're relying on.

Who it fits

Operations teams running scheduled data syncs, reports, or nightly batch jobs that must never overlap.

How it works

  1. On a schedule, the system checks whether the main job is already marked as running
  2. If it's still running, the new attempt is skipped instead of starting a duplicate
  3. If it's finished, the system flags it as running and starts the main job
  4. The running flag automatically clears itself after a set time limit, even if something crashes
What you get

Duplicate runs that never collide

You get a scheduled job that never overlaps with itself, so nightly runs stay clean and reliable.

What you get

A safeguard that guarantees only one copy of a scheduled job runs at a time.

What you need

A Redis database and whatever accounts the main scheduled job itself requires.

We can build this. But should you?

The hard question is not how to build it. It is whether this is the right thing to build first.

That is what a Fractional Chief AI Officer figures out with you, before anyone writes a line of code.

Let's Talk Strategy

Related automations

Back to the AI Playbook