# How to use the "Await Webhook" Step in Flows

The **"Await Webhook"** step in Flows is used to pause a workflow until it receives a specific **event** via a webhook. This is useful when you need to wait for an external event or system to trigger the continuation of a workflow, such as receiving a payment confirmation, user input, or a third-party API response.

### **Step Configuration Overview**  <a href="#ienq96j43yco" id="ienq96j43yco"></a>

### ![](https://3861485111-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FU9kiDiTGVD8kkbnKKyEn%2Fuploads%2FexQ7bIVQ74SDrowu0Fnk%2F0.png?alt=media) <a href="#m6099954477n" id="m6099954477n"></a>

When configuring the "Await Webhook" step, you’ll need to complete the following:

#### You’ll need to provide a **resume\_key.** *Read further to learn more about it.* <a href="#id-76vuaghaxi82" id="id-76vuaghaxi82"></a>

* You’ll also need to provide a wait until(fail after) time. This by default is 5mins. Usually doesn’t need any longer for most use cases like waiting for a payment confirmation while ordering food, etc.

### **Resume Key** <a href="#fcpv5ziovmc4" id="fcpv5ziovmc4"></a>

The **Resume Key** is a unique value used to correlate the webhook call with the exact instance of the flow execution that should be resumed.

* This key can be dynamically set using variables (e.g., user email, ID, or session token).<br>
* You can choose from existing variables in your flow or add a custom one.<br>
* The resume key should be more than **10 characters long.**

**Note**: The webhook **will not resume the flow** unless the correct resume key is provided.

### **Fail After** <a href="#id-5f81k663ixmf" id="id-5f81k663ixmf"></a>

This configuration allows you to define a timeout for the webhook to be triggered. If no incoming request with the correct resume key is received within the set time:

* The flow will **fail**.<br>
* You can handle this failure using a conditional or fallback path in your flow.<br>

**Example:**\
Set Duration = 5 Minutes to allow a 5-minute window for the webhook to be triggered.

### **Resuming the Flow via CURL** <a href="#id-526al32mkpok" id="id-526al32mkpok"></a>

Here’s a sample curl request to trigger the resume of a paused flow:

```
curl --request PATCH \
--url https://api.bird.com/workspaces/87608cb1-4f46-4a7e-8edb-c124e36de599/flows/05073d44-23ea-48d4-84df-0fc0de0ab017/runs \
--header 'Authorization: AccessKey $MY_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"action": "resume",
"resumeKey": "$MY_RESUME_KEY",
"resumeExtraInput": {
"custom_key": "The resumeExtraInput is optional and can accept JSON input"
}
}'
```

#### **Required Parameters:** <a href="#p4pwo5f0cubz" id="p4pwo5f0cubz"></a>

| **Parameter**    | **Description**                                                                                    |
| ---------------- | -------------------------------------------------------------------------------------------------- |
| $MY\_TOKEN       | Replace with your actual API access token. You could find this in your security settings           |
| $MY\_RESUME\_KEY | Replace with the resume key provided during flow execution, should be more than 10characters long. |
| resumeExtraInput | Optional JSON object. You can include additional payload if needed.                                |

### **Example Use Case** <a href="#r6ncxowz01l0" id="r6ncxowz01l0"></a>

Let’s say you're waiting for a user to complete an identity verification process. You send their info to a 3rd-party service, then pause the flow using **"Await Webhook"**.

Once the verification is complete, the third-party system sends a webhook call using the correct resume key to continue the flow. Optionally, it could also send back verification status or additional metadata in resumeExtraInput.

```
{
"action": "resume",
"resumeKey": "$MY_RESUME_KEY",
"resumeExtraInput": {
"payment_type" : "credit card",
"payment_status" : "succesful"
    }
}
```

![](https://3861485111-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FU9kiDiTGVD8kkbnKKyEn%2Fuploads%2FEX3yGwO5jOExobxqTNnO%2F1.png?alt=media)

### **Additional Tips** <a href="#p3vm4cxnlvcb" id="p3vm4cxnlvcb"></a>

* Always **secure the resume endpoint** using your API Access Key.<br>
* Use meaningful resume keys to avoid collisions or incorrect resumptions.

By configuring and using the **"Await Webhook"** step properly, you can make your workflows more dynamic, interactive, and event-driven.
