Now that you know when to use send to story, let's dive into the technical details of how it works. To use send to story, you need two things: A sub-story configured to receive calls, and a parent story with a send to story action that calls it.
Parent story: The story that contains the send to story action. It initiates the call, sends data to the sub-story, and receives the result.
Sub-story: The story that receives the data, performs its logic, and returns a result. It must be configured to accept incoming calls and define what data it returns.
❗️Important
Configure a sub-story
Entry and exit actions
Before you can enable send to story on a sub-story, you need to have an entry action and an exit action placed on your storyboard:
Entry action: The Webhook action that becomes the starting point for all runs triggered through send to story. When a parent story calls your sub-story, the data it sends becomes the event that triggers this entry action.
Exit action: The Event Transformation action (in message-only mode) that returns data to the parent story. Whatever data this action emits is what the parent story will receive and can use in subsequent actions.
❗️Important
Enable send to story
Once you've configured your entry and exit actions, it's time to enable send to story on your sub-story. Let's walk through enabling send to story in the following emulation:
🖐️ Try this: Enable send to story
Connect a parent story to a sub-story
Once you have a configured sub-story, calling it from a parent story is straightforward. Let's walk through how to set this up in the following emulation:
🖐️ Try this: Connect a parent story to a sub-story
The synchronous nature of send to story
When a parent story reaches a send to story action in its run, it pauses and waits for the sub-story to complete. The sub-story runs its entire workflow, from entry action to exit action, and then returns control to the parent. This synchronous behavior is important to understand because it means:
The parent story won't continue until the sub-story finishes.
If the sub-story fails, the parent story will see that failure.
The parent story receives the exact data emitted by the sub-story's exit action.
This makes send to story predictable and reliable, but it also means you should design sub-stories to complete in a reasonable time.