docs: clarify how emitEventStep emits an event in a workflow (#13836)

This commit is contained in:
Shahed Nasser
2025-10-23 16:30:25 +03:00
committed by GitHub
parent 90966633bb
commit 4ab185c685
81 changed files with 479 additions and 3 deletions
@@ -38,7 +38,7 @@ Some examples of service events:
## Emit Event in a Workflow
To emit a workflow event, use the `emitEventStep` helper step provided in the `@medusajs/medusa/core-flows` package.
To emit a workflow event, use the `emitEventStep` helper step provided in the `@medusajs/medusa/core-flows` package. It allows you to emit an event from within a workflow, and it only emits the event after the workflow has finished successfully.
For example:
@@ -162,6 +162,12 @@ const myWorkflow = createWorkflow(
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -216,6 +216,12 @@ Handlers consuming this hook accept the following input.
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -273,6 +273,12 @@ Handlers consuming this hook accept the following input.
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -179,6 +179,12 @@ Handlers consuming this hook accept the following input.
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -296,6 +296,12 @@ Handlers consuming this hook accept the following input.
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -181,6 +181,12 @@ Handlers consuming this hook accept the following input.
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -262,6 +262,12 @@ Handlers consuming this hook accept the following input.
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -249,6 +249,12 @@ Handlers consuming this hook accept the following input.
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -167,6 +167,12 @@ const myWorkflow = createWorkflow(
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -199,6 +199,12 @@ Handlers consuming this hook accept the following input.
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -175,6 +175,12 @@ Handlers consuming this hook accept the following input.
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -152,6 +152,12 @@ const myWorkflow = createWorkflow(
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -193,6 +193,12 @@ Handlers consuming this hook accept the following input.
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -142,6 +142,12 @@ const myWorkflow = createWorkflow(
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -156,6 +156,12 @@ const myWorkflow = createWorkflow(
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -172,6 +172,12 @@ const myWorkflow = createWorkflow(
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -151,6 +151,12 @@ const myWorkflow = createWorkflow(
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -139,6 +139,12 @@ const myWorkflow = createWorkflow(
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -147,6 +147,12 @@ const myWorkflow = createWorkflow(
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -142,6 +142,12 @@ const myWorkflow = createWorkflow(
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -139,6 +139,12 @@ const myWorkflow = createWorkflow(
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -188,6 +188,12 @@ Handlers consuming this hook accept the following input.
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -175,6 +175,12 @@ Handlers consuming this hook accept the following input.
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -184,6 +184,12 @@ Handlers consuming this hook accept the following input.
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -148,6 +148,12 @@ const myWorkflow = createWorkflow(
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -148,6 +148,12 @@ const myWorkflow = createWorkflow(
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -147,6 +147,12 @@ const myWorkflow = createWorkflow(
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -147,6 +147,12 @@ const myWorkflow = createWorkflow(
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -147,6 +147,12 @@ const myWorkflow = createWorkflow(
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -223,6 +223,12 @@ Handlers consuming this hook accept the following input.
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -205,6 +205,12 @@ Handlers consuming this hook accept the following input.
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -202,6 +202,12 @@ Handlers consuming this hook accept the following input.
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -145,6 +145,12 @@ const myWorkflow = createWorkflow(
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -151,6 +151,12 @@ const myWorkflow = createWorkflow(
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -143,6 +143,12 @@ const myWorkflow = createWorkflow(
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -154,6 +154,12 @@ const myWorkflow = createWorkflow(
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -151,6 +151,12 @@ const myWorkflow = createWorkflow(
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -145,6 +145,12 @@ const myWorkflow = createWorkflow(
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -150,6 +150,12 @@ const myWorkflow = createWorkflow(
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -141,6 +141,12 @@ const myWorkflow = createWorkflow(
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -208,6 +208,12 @@ const myWorkflow = createWorkflow(
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -221,6 +221,12 @@ const myWorkflow = createWorkflow(
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -193,6 +193,12 @@ Handlers consuming this hook accept the following input.
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -216,6 +216,12 @@ Handlers consuming this hook accept the following input.
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -193,6 +193,12 @@ Handlers consuming this hook accept the following input.
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -193,6 +193,12 @@ Handlers consuming this hook accept the following input.
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -239,6 +239,12 @@ Handlers consuming this hook accept the following input.
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -271,6 +271,12 @@ Handlers consuming this hook accept the following input.
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -170,6 +170,12 @@ Handlers consuming this hook accept the following input.
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -170,6 +170,12 @@ Handlers consuming this hook accept the following input.
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -169,6 +169,12 @@ Handlers consuming this hook accept the following input.
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -170,6 +170,12 @@ Handlers consuming this hook accept the following input.
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -172,6 +172,12 @@ Handlers consuming this hook accept the following input.
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -172,6 +172,12 @@ Handlers consuming this hook accept the following input.
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -205,6 +205,12 @@ This example API route uses the same implementation as the [Confirm Product Impo
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -205,6 +205,12 @@ Handlers consuming this hook accept the following input.
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -204,6 +204,12 @@ Handlers consuming this hook accept the following input.
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -205,6 +205,12 @@ Handlers consuming this hook accept the following input.
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -205,6 +205,12 @@ Handlers consuming this hook accept the following input.
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -387,6 +387,12 @@ Handlers consuming this hook accept the following input.
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -385,6 +385,12 @@ Handlers consuming this hook accept the following input.
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -179,6 +179,12 @@ Handlers consuming this hook accept the following input.
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -160,6 +160,12 @@ Handlers consuming this hook accept the following input.
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -191,6 +191,12 @@ Handlers consuming this hook accept the following input.
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -163,6 +163,12 @@ const myWorkflow = createWorkflow(
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -140,6 +140,12 @@ const myWorkflow = createWorkflow(
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -167,6 +167,12 @@ const myWorkflow = createWorkflow(
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -151,6 +151,12 @@ const myWorkflow = createWorkflow(
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -140,6 +140,12 @@ const myWorkflow = createWorkflow(
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -163,6 +163,12 @@ const myWorkflow = createWorkflow(
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -207,6 +207,12 @@ Handlers consuming this hook accept the following input.
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -176,6 +176,12 @@ Handlers consuming this hook accept the following input.
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -211,6 +211,12 @@ Handlers consuming this hook accept the following input.
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -166,6 +166,12 @@ const myWorkflow = createWorkflow(
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -163,6 +163,12 @@ const myWorkflow = createWorkflow(
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -143,6 +143,12 @@ const myWorkflow = createWorkflow(
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -146,6 +146,12 @@ const myWorkflow = createWorkflow(
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -155,6 +155,12 @@ const myWorkflow = createWorkflow(
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
:::note
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
:::
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
<Table>
@@ -25,9 +25,17 @@ A Tax Module Provider is used to retrieve the tax lines in a provided context. T
---
## Implementation Example
As you implement your Tax Module Provider, it can be useful to refer to an existing provider and how it's implemeted.
If you need to refer to an existing implementation as an example, check the [Avalara Tax Module Provider tutorial](https://docs.medusajs.com/resources/integrations/guides/avalara).
---
## Understanding Tax Module Provider Implementation
The Tax Module Provider handles calculating taxes with a third-party provirder. However, it's not responsible for managing tax concepts within Medusa, such as creating a tax region. The Tax Module uses your Tax Module Provider within core operations.
The Tax Module Provider handles calculating taxes with a third-party provider. However, it's not responsible for managing tax concepts within Medusa, such as creating a tax region. The Tax Module uses your Tax Module Provider within core operations.
For example, during checkout, the Tax Module Provider of the tax region that the customer is in is used to calculate the tax for the cart and order. So, you only have to implement the third-party tax calculation logic in your Tax Module Provider.
@@ -17,7 +17,7 @@ export default function () {
return ""
}
let str = `${Handlebars.helpers.titleLevel()} Emitted Events\n\nThis section lists the events that are either triggered by the \`emitEventStep\` in the workflow, or by another workflow executed within this workflow.\n\nYou can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.\n\n`
let str = `${Handlebars.helpers.titleLevel()} Emitted Events\n\nThis section lists the events that are either triggered by the \`emitEventStep\` in the workflow, or by another workflow executed within this workflow.\n\n:::note\n\nThe \`emitEventStep\` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.\n\n:::\n\nYou can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.\n\n`
str += `<Table>\n`
str += ` <Table.Header>\n`