Should an AI Agent Run on Events or a Schedule?
Should an AI agent run on events or a schedule?
Choose an event-driven AI agent workflow when a business change needs a prompt response and the source system can reliably report it. Choose a scheduled workflow when a defined delay is acceptable, the work belongs in batches, or the source must be queried for changes. For ERP and CRM integrations, consider combining event triggers with a scheduled check that finds work the event path missed.
Start with the process deadline, then check the source system’s capabilities and the shape of the workload. Neither trigger removes the need for duplicate protection, recovery rules or approval steps.
What does each trigger mean?
An event trigger starts work after a notification of a change: an order is approved, a lead is assigned, or a document becomes available. Treat the notification as a reason to inspect the relevant record before deciding what to do.
A scheduled trigger starts work at a defined interval or business checkpoint. It might query changed records, collect outstanding cases or prepare a batch for review.
Polling is one use of a schedule: repeatedly asking a source what changed. A scheduled workflow can also perform a calculation or review across existing records without looking for new changes.
Keep the trigger separate from the agent’s authority. Starting a workflow does not have to mean allowing it to write back immediately. Define permitted actions and where human approval belongs independently.
Which questions should determine the choice?
Write down the maximum acceptable delay between the business change and the required response. Then assess whether the integration can meet that delay during ordinary operation and after an interruption.
| Decision | Prefer events when… | Prefer a schedule when… |
|---|---|---|
| Response time | Work should begin promptly after each change | Work can wait for a defined interval or checkpoint |
| Source capability | Relevant notifications and recovery options are available | The source provides a usable query or export |
| Workload shape | Individual changes deserve separate attention | Records need grouping, comparison or batch approval |
| Business timing | The change itself makes work ready | A cut-off or completed batch makes work ready |
| Recovery | Events can be replayed or checked against source records | A saved checkpoint can support repeatable queries |
Do not select events solely because the integration offers them. A notification that a record was created may be too early if the agent needs its approved, complete version.
Likewise, distinguish the required start time from the completion deadline. A prompt trigger does not solve a queue that takes too long to clear.
What should you check in the ERP or CRM?
Ask for the source’s documented behaviour before choosing the trigger.
For events, establish:
- Which changes generate notifications, including approvals, cancellations and deletions.
- Whether notifications identify the record, its version and the event itself.
- Whether delivery can repeat or arrive out of order.
- What retry, replay and retention options exist.
- Whether the notification contains enough information or requires a fresh read.
For polling, establish:
- Whether queries can filter and sort changes consistently.
- Which timestamp or change identifier represents an update.
- How pagination behaves while records continue changing.
- How deletions, archived records and permission changes become visible.
- Which query limits constrain the proposed interval.
Treat an undocumented answer as an unresolved dependency. If the integration cannot identify changes reliably, narrow the pilot or arrange a reconciliation method before allowing automatic writes.
The source connection also needs an explicit data boundary. Decide what data the agent should be able to see before giving it broad search access.
How should duplicate and out-of-order events work?
Design duplicate handling at two levels.
First, recognise repeated delivery of the same event, using a stable event identifier where available. Second, protect the business action itself. Different notifications might all lead to the same proposed action, such as creating a follow-up task for one approved order.
Keep a durable record of that intended action and its outcome. When the destination supports an idempotency key, use a stable key for the same intended action so a retry does not request a separate action.
Define what happens if the destination accepts a write but the workflow stops before recording success. Check for the existing result before repeating an action whose outcome is uncertain.
For out-of-order notifications, compare versions where supported and read the current source state when necessary. An older notification should not reverse a newer decision.
Decide whether the process needs every transition or only the latest state. An audit-sensitive sequence requires a different recovery design from a task that refreshes a current summary.
How should polling windows and checkpoints work?
Define a polling window with an explicit lower and upper boundary. Save progress only after the selected records have a durable outcome: completed, safely queued, or recorded as an exception.
Illustrative example: a workflow polls every ten minutes and overlaps the previous window by two minutes. That overlap is a design choice to test against the source’s behaviour, not a guarantee against missed changes.
Use duplicate protection to make overlapping reads safe. Do not assume that querying everything after the last run time is enough.
Specify these details:
- Boundary rules: whether records exactly at the boundary are included.
- Timestamp ties: how records sharing an update time are ordered and resumed.
- Pagination: how the window stays consistent across pages.
- Late visibility: how changes that become queryable later are recovered.
- Checkpoint ownership: how overlapping runs avoid advancing each other’s progress incorrectly.
Prefer a source-provided change cursor when its documented guarantees fit the process. If using timestamps, agree on the time basis and test boundary cases.
What should happen after an outage or missed event?
Catch-up should be a defined operating mode.
On recovery, resume from the last confirmed checkpoint or replay position. Apply the same duplicate checks, validation and approval rules used during normal operation.
Separate work into three groups: still required, no longer relevant, and needing review. An old reminder may be inappropriate after the customer has already replied. An incomplete order hand-off may still require action.
For an event-driven integration, consider a scheduled reconciliation that compares eligible source records with recorded outcomes. Both entry points should use the same action rules and completion history.
Set a recovery pace that respects source and destination limits. Give an owner visibility into backlog age, unresolved failures and uncertain write outcomes. Do not silently advance the checkpoint to the present and discard the gap.
What would this look like in an ERP-to-CRM workflow?
Consider an agent that prepares a CRM follow-up after an ERP order is approved.
Illustrative design: the business wants preparation to begin within five minutes. The ERP offers approval notifications and a query for approved orders.
Use the notification to start work. Read the current order, confirm it remains eligible, and check whether its follow-up already exists. Let the agent draft the follow-up within agreed boundaries; require approval before any customer communication.
Run a scheduled reconciliation over approved orders and their recorded outcomes. If a notification was missed, reconciliation submits the same work through the same duplicate checks.
After an interruption, prioritise still-relevant orders and route changed or cancelled cases for review. Test the complete process against the response requirement before treating the design as accepted.
Which common mistakes should you avoid?
- Treating arrival as readiness. Confirm that required fields and approvals are complete.
- Assuming each event means a new action. Protect the business outcome against repeated requests.
- Using a schedule without a checkpoint. Define exactly where recovery resumes.
- Choosing an overlap arbitrarily. Test it against delayed visibility and source behaviour.
- Running catch-up without relevance checks. Reassess whether old work should still happen.
- Letting reconciliation become a separate implementation. Share validation and action rules across triggers.
Before launch, test duplicate delivery, a missed event, timestamp ties, an interrupted page and an uncertain write. Define the expected outcome for each case. Include these acceptance conditions when planning an AI pilot.
Can one AI agent use both events and schedules?
Yes. Events can initiate individual cases while a schedule checks for missing work or prepares a batch. Use shared eligibility rules, duplicate protection and outcome records so the triggers cooperate.
How often should a scheduled agent run?
Choose an interval that leaves enough time for querying, queueing, processing and any required review within the business deadline. Validate that interval against source limits and peak workload. There is no universal polling interval.
When is neither trigger enough?
If the source exposes neither dependable change notifications nor a reliable way to query eligible work, changing the trigger will not resolve the gap. Start with a controlled export or supervised hand-off while establishing a dependable integration contract.