What is difference between After and Async Business Rules please explain with real time scenario

SreenadhChenna
Tera Contributor

Hi,

What is difference between After and Async Business Rules please explain with real time scenario.

Please let me know with the Example.

 

Thanks,

 

8 REPLIES 8

AndersBGS
Tera Patron

Hi @SreenadhChenna 

 

Async Business Rules are similar to after rules in that they run after the database commits a change. Unlike after rules, async rules run in the background simultaneously with other processes. Async Business Rules allow ServiceNow to return control to the user sooner but may take longer to update related objects.

 

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.

 

best regards

Anders

If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.

Best regards
Anders

Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/

Saurabh Bhoi
Tera Contributor

After Business Rule: Runs after a record is inserted, updated, or deleted, ensuring that all database operations are complete before executing. It runs synchronously, meaning the user waits for the rule to finish before continuing.

 

Asynchronous Business Rule: Runs in the background after the current transaction is complete, allowing the user to continue without waiting. It's ideal for non-urgent tasks like sending notifications or updating related records.

Atul111
Tera Contributor

One of the good example of After and Async Br is:

Customer requirement is to Resolved all the child incidents once the Parent Incident Resolved.

After BR - Update action, User will be on the same page until all the child records will not resolved after resolving the Parent Incident.

Async BR - User will be redirected to the next page and there will be a schedule job created and will be queued, once the system will be free it will be executed on backend.

Please let me know if any doubt.

VaishnaviK43271
Tera Contributor

Hi @SreenadhChenna !!

 

After Business Rule

After Business Rules run immediately after the record is committed to the database, within the same transaction.

 

Key points:

  • Runs synchronously

  • User waits until the rule finishes

  • Executes right after the save

  • Suitable for lightweight logic

 When to use

Use an After Business Rule when the action must happen immediately after saving the record.

 

 Real-time scenario

Send a notification when an Incident is resolved

You want to ensure the Incident is already saved as Resolved before triggering the notification.

 

Example

Table: Incident
When: After
Condition: State changes to Resolved

if (current.state == 6 && previous.state != 6) {
    gs.eventQueue(
        'incident.resolved',
        current,
        current.caller_id,
        current.number
    );
}

 

Async Business Rule

Async Business Rules run after the record is saved, but in a separate background thread.

 

Key points:

  • Runs asynchronously

  • User does not wait

  • Improves performance

  • Best for heavy processing

 When to use

Use an Async Business Rule when the logic is time-consuming or affects many records.

 

 Real-time scenario

Close all related incidents when a CI is retired

Updating many related records in an After rule would slow down the save action.

 

Example

Table: cmdb_ci
When: Async
Condition: State changes to Retired

var inc = new GlideRecord('incident');
inc.addQuery('cmdb_ci', current.sys_id);
inc.query();

while (inc.next()) {
    inc.state = 7; // Closed
    inc.update();
}

The CI saves instantly, and the related updates run in the background.

 

Mark this as Helpful if it clarifies the issue.
Accept the solution if this answers your question.

Regards,
Vaishnavi
Associate Technical Consultant