> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

## Resource: Sample Flows

## Article: Sample Flows

## Article Link: https://dev.wix.com/docs/api-reference/business-management/automations/triggers/triggered-events/sample-flows.md

## Article Content:

# Triggered Events: Sample Flows

This article presents possible use cases and corresponding sample flows that you can support. It provides a useful starting point as you plan your implementation.

## Report an event and cancel it when it's no longer relevant

Your app reports an event that activates the site's automations, then cancels it if the event becomes irrelevant before the automations finish. For example, you report an invoice overdue event, then cancel it once the customer pays.

To report an event and later cancel it:

1. Call [Report Event](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/triggered-events/report-event.md) with the `triggerKey` and an `externalEntityId`. The `externalEntityId` is required to cancel the event later.
1. When the event is no longer relevant, call [Cancel Event](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/triggered-events/cancel-event.md) with the same `triggerKey` and `externalEntityId`. Any remaining actions for that event are canceled.

## Bulk report events and later bulk cancel them

Your app reports many events at once and later cancels them together when they're no longer relevant. For example, a customer books multiple sessions and then cancels all of them, so you cancel all the related reminders.

To bulk report events and later bulk cancel them:

1. Call [Bulk Report Event](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/triggered-events/bulk-report-event.md) with the `triggerKey` and an `eventsInfo` entry for each event. Include an `externalEntityId` for each event you might cancel later.
1. Check `bulkActionMetadata` in the response for the success and failure totals.
1. When the events are no longer relevant, call [Bulk Cancel Event](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/triggered-events/bulk-cancel-event.md) with the same `triggerKey` and the relevant `externalEntityIds`.

## Run an automation when no triggering event occurs

Your app activates an automation manually when the usual triggering event doesn't happen in your system. For example, an automation sends a booking confirmation when a customer books online, but the customer books by phone instead, so you run the automation directly.

To run an automation directly:

1. Retrieve the automation's ID from the [Automations API](https://dev.wix.com/docs/rest/business-management/automations/introduction.md).
1. Call [Run Automation](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/triggered-events/run-automation.md) with `identifierType` set to `AUTOMATION`, the `automationIdentifier`, and the `payload` the automation expects.

## Retry a failed activation

Your app reruns an activation that failed, after you've resolved whatever caused the failure. The rerun reuses the original activation's payload and creates a new activation.

To retry a failed activation:

1. Find the failed activation's ID in the automation's run log on the automations page.
1. Call [Rerun Activation](https://dev.wix.com/docs/api-reference/business-management/automations/triggers/triggered-events/rerun-activation.md) with the `activationId`. To run the automation immediately, set `options.skipDelays` to `true`.