Home › DevOps › AutoSys Condition on Two Boxes, and Only Today's Run (Lookback)
Intermediate 3 min · November 08, 2026

AutoSys Condition on Two Boxes, and Only Today's Run (Lookback)

Make an AutoSys job wait for two boxes with condition: s(BOX_A) & s(BOX_B).

N
Naren Founder & Principal Engineer

20+ years shipping production infrastructure and CI/CD at scale. Notes here come from systems that actually shipped.

Follow
✓ Production
production tested
November 09, 2026
last updated
2,128
articles · all by Naren
Before you start⏱ 6 min
  • ✓AutoSys JIL basics
 ● Production Incident 🔎 Debug Guide
⚡Quick Answer
  • Wait for two boxes: condition: s(BOX_A) & s(BOX_B).
  • Either one: condition: s(BOX_A) | s(BOX_B).
  • s() checks the LAST completed run, even yesterday's.
  • Only today's run: add a lookback, s(BOX_A, 06.00) = success in the last 6 hours.
  • Pick a lookback shorter than the time between runs.
✦ Definition~90s read
What is AutoSys Condition on Two Boxes (Lookback)?

An AutoSys condition can combine any number of jobs or boxes with & (and) and | (or). s(JOB) is true when the job's last completed run ended in SUCCESS, which can be yesterday's run. Adding a lookback, s(JOB, hh.mm), requires that success to be within that many hours and minutes.

★
s(BOX) asks "did the last delivery arrive?" and a note from yesterday still says yes.
Plain-English First

s(BOX) asks "did the last delivery arrive?" and a note from yesterday still says yes. A lookback asks "did a delivery arrive in the last six hours?", which yesterday's note can't answer.

Yes, a job can depend on two boxes. The trap is that s() looks at the last run, not today's. A report that waits for two boxes can start on yesterday's success of a box that hasn't run yet today. A lookback fixes that.

Two Boxes with &

Join conditions with & so the job waits for both, or | for either. Boxes are referenced like jobs.

two_boxes.jilJIL
1
2
update_job: RPT_DAILY
condition: s(LOAD_BOX) & s(RISK_BOX)
🎯 Key Takeaway
& = both, | = either.

The Last-Run Trap

s(JOB) evaluates the status of the job's last completed run. If the upstream ran successfully yesterday and hasn't run yet today, the condition is still true.

check.shBASH
1
autorep -J RISK_BOX   # Last End shows yesterday
🎯 Key Takeaway
Yesterday's SUCCESS satisfies s().

Lookback

Add hh.mm after the job name: the success must have happened within that window. Choose a window shorter than the gap between runs, so only the current run can match.

lookback.jilJIL
1
2
update_job: RPT_DAILY
condition: s(LOAD_BOX, 06.00) & s(RISK_BOX, 06.00)
💡Other statuses
Lookback works with f(), d() and t() too, e.g. d(JOB, 12.00) = done in the last 12 hours.
🎯 Key Takeaway
s(JOB, 06.00) = success in the last 6 hours.
● Production incidentPOST-MORTEMseverity: high

The Report Built on Yesterday's Data

Symptom
The report succeeded with yesterday's risk figures.
Assumption
The team thought the condition guaranteed both boxes had finished today.
Root cause
condition: s(LOAD_BOX) & s(RISK_BOX). RISK_BOX's last completed run, from the previous night, was SUCCESS, so the condition was already true.
Fix
Changed to s(LOAD_BOX, 06.00) & s(RISK_BOX, 06.00).
Key lesson
  • s() means last completed run.
  • Use a lookback when the dependency must be today's run.
Production debug guideWhy did it start, or not?2 entries
Symptom · 01
Started too early
→
Fix
Check the upstream's last end time with autorep; add a lookback.
Symptom · 02
Never starts
→
Fix
autorep -J JOB -q to see the condition; check each upstream's status and the lookback window.
⚙ Quick Reference
3 commands from this guide
FileCommand / CodePurpose
two_boxes.jilupdate_job: RPT_DAILYTwo Boxes with &
check.shautorep -J RISK_BOX # Last End shows yesterdayThe Last-Run Trap
lookback.jilupdate_job: RPT_DAILYLookback

Key takeaways

1
& joins conditions; | is or.
2
s() looks at the last completed run.
3
Lookback limits it to a time window.
4
Use lookback for same-day dependencies.

Common mistakes to avoid

2 patterns
×

No lookback on daily dependencies

Symptom
Runs on yesterday's upstream.
Fix
Add a lookback shorter than a day.
×

Lookback too short

Symptom
Job never starts if the upstream finished earlier.
Fix
Size it from the upstream's normal end time.
INTERVIEW PREP · PRACTICE MODE

Interview Questions on This Topic

Q01JUNIOR
Can an AutoSys job depend on two boxes?
Q02SENIOR
What is a lookback in an AutoSys condition?
Q01 of 02JUNIOR

Can an AutoSys job depend on two boxes?

ANSWER
Yes: condition: s(BOX_A) & s(BOX_B).
FAQ · 2 QUESTIONS

Frequently Asked Questions

01
Can we give success of two boxes in an AutoSys condition?
02
How do I depend on today's run of a job?
COMPLETE GUIDE
The Complete AutoSys Workload Automation Guide for Engineers →

JIL syntax, sendevent, autorep, box jobs, file watchers, scheduling, HA, security, cloud workload automation, and 22 interview questions — the definitive AutoSys reference for production engineers.

N
Naren Founder & Principal Engineer

20+ years shipping production infrastructure and CI/CD at scale. Notes here come from systems that actually shipped.

Follow
✓ Verified
production tested
November 09, 2026
last updated
2,128
articles · all by Naren
🔥

That's AutoSys. Mark it forged?

3 min read · try the examples if you haven't

←
Previous
AutoSys Real vs Virtual Machines
42 / 49 · AutoSys
Next
AutoSys: List Only Failed Jobs
→