> ## Documentation Index
> Fetch the complete documentation index at: https://docs.odella.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Wait For Event Block

> Pause flow execution until a specific event is raised, enabling synchronization with external actions or other parts of the flow

## Overview

The Wait For Event Block pauses the execution of a flow until a specific event is raised by a [Raise Event Block](/block-reference/advanced/raise-event) or the host project. This block is crucial for scenarios where you need to synchronize your flow with external actions or other parts of the flow.

<Frame>
  <img src="https://mintcdn.com/odella/PGZ7enNCqh0mvwj_/block-reference/assets/wait_for_event_light.png?fit=max&auto=format&n=PGZ7enNCqh0mvwj_&q=85&s=8c3a84b75df1f73c82babe49a66b9bb1" alt="Wait For Event Block Screenshot" className="block dark:hidden" width="604" height="354" data-path="block-reference/assets/wait_for_event_light.png" />

  <img src="https://mintcdn.com/odella/PGZ7enNCqh0mvwj_/block-reference/assets/wait_for_event_dark.png?fit=max&auto=format&n=PGZ7enNCqh0mvwj_&q=85&s=c2f4d81f13adf90235cf3b24ef285c81" alt="Wait For Event Block Screenshot" className="hidden dark:block" width="648" height="350" data-path="block-reference/assets/wait_for_event_dark.png" />
</Frame>

## Inputs

<ParamField path="Event Name" type="string">
  The name of the event to wait for. This input is only available if `Use Event Name Input` is enabled in the settings. The value will be coerced to a string.
</ParamField>

<ParamField path="Data" type="any">
  Any data to be passed through the block. This data will be outputted from the `Data` output port. Optional.
</ParamField>

## Outputs

<ResponseField name="Data" type="any">
  The data passed in through the `Data` input port, passed through unchanged. If no data was provided to the input, this output will not be available.
</ResponseField>

<ResponseField name="Event Data" type="any">
  The data associated with the event that was raised. The type depends on what data was included when the event was raised. If the event has no associated data, this output will not be available.
</ResponseField>

## Editor Settings

<ParamField path="Event Name" type="string" default="continue">
  The name of the event to wait for. Must match the name of the event raised by the Raise Event Block or the host project. Only used if `Use Event Name Input` is disabled.
</ParamField>

<ParamField path="Use Event Name Input" type="boolean" default={false}>
  If enabled, the Event Name can be provided via the Event Name input port instead of being set in the settings.
</ParamField>

## Examples

### Example: Synchronizing with a Raise Event Block

1. Create a [Raise Event Block](/block-reference/advanced/raise-event) and set the `Event Name` to `myEvent`.
2. Add a Wait For Event Block and set the `Event Name` to `myEvent`.
3. Connect a Text Block with "Raise Event" to the Raise Event Block's Data input.
4. Connect another Text Block with "Waited" to the Wait For Event Block's Data input.
5. Connect both blocks' outputs to separate Text Blocks.
6. Run the flow. The Wait For Event Block will pause until the Raise Event Block raises `myEvent`.
7. Observe how the Wait For Event Block outputs both its input data and the event data.

## Error Handling

The Wait For Event Block does not generate errors under normal circumstances. If the expected event is not raised, the block will wait indefinitely.

## FAQ

<AccordionGroup>
  <Accordion title="Can I use the Wait For Event Block to wait for multiple events?">
    No, each Wait For Event Block can only wait for a single event. To wait for multiple events, use multiple Wait For Event Blocks.
  </Accordion>

  <Accordion title="Can I use the Wait For Event Block with API calls?">
    Yes, you can use an [HTTP Call Block](/block-reference/advanced/http-call) to make an API call, then use the Wait For Event Block to wait for an event raised in response to that call.
  </Accordion>
</AccordionGroup>

## See Also

* [Raise Event Block](/block-reference/advanced/raise-event)
* [HTTP Call Block](/block-reference/advanced/http-call)
* [External Call Block](/block-reference/advanced/http-call)
* [Code Block](/block-reference/advanced/code)
