# Pipedream recipes

> Send texts and react to replies in Pipedream workflows, with code steps where you need them.

Two recipes for Pipedream. Each names its trigger and the BlueBot step, lists the fields to map and says how to test it with your own number before anyone else gets a text.

## How Pipedream connects

- **[Pipedream](https://usebluebot.com/docs/pipedream)**: BlueBot’s Pipedream components send texts and start workflows from BlueBot’s webhooks.

## Text customers when your app says an order is ready

| Part             | What it is                                    |
| ---------------- | --------------------------------------------- |
| Trigger          | Your app posts to the workflow’s HTTP trigger |
| Action           | BlueBot’s **Send Text** action                |
| Connects through | [Pipedream](https://usebluebot.com/docs/pipedream)                  |

### Steps

1. Start the workflow with an HTTP trigger and have your app post to its address when an order is ready.
2. Add BlueBot’s Send Text action and map the customer’s number from the request body.
3. Write the text with the order number mapped in.

### Map the fields

| BlueBot field                  | Map it to                                                                                                                                      |
| ------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| To                             | The person’s mobile number from Pipedream. US numbers can leave off the +1.                                                                    |
| Text                           | Hi {{first_name}}, order {{order_number}} is ready to pick up. We’re open until 6 today.                                                   |
| `{{first_name}}` in the text   | Pipedream’s first name field.                                                                                                                  |
| `{{order_number}}` in the text | Pipedream’s order number field.                                                                                                                |
| Metadata                       | `source` set to `pipedream`, and `record_id` set to the record’s id, so the status and reply webhooks for this text can find the record again. |
| Service                        | Auto, the default: iMessage when the person uses it, otherwise SMS through your iPhone.                                                        |

### Test it

Put your own number in **To** and press **Test**. A text arrives on your phone, and the step’s output shows the message. Then map Pipedream’s field back into **To**.

## Answer a text that asks about an order

| Part             | What it is                                           |
| ---------------- | ---------------------------------------------------- |
| Trigger          | A text comes in (BlueBot’s message.received webhook) |
| Action           | BlueBot’s **Send Text** action                       |
| Connects through | [Pipedream](https://usebluebot.com/docs/pipedream)                         |

### Steps

1. Start the workflow from BlueBot’s message.received webhook.
2. In a code step, find an order number in the text and look up its status in your own system.
3. Reply with BlueBot’s Send Text action to the number the text came from.

### Map the fields

| BlueBot field                  | Map it to                                                                                                                                      |
| ------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| To                             | The person’s mobile number from Pipedream. US numbers can leave off the +1.                                                                    |
| Text                           | Order {{order_number}} shipped on {{ship_date}}. You can track it here: {{tracking_url}}                                                 |
| `{{order_number}}` in the text | Pipedream’s order number field.                                                                                                                |
| `{{ship_date}}` in the text    | Pipedream’s ship date field.                                                                                                                   |
| `{{tracking_url}}` in the text | Pipedream’s tracking url field.                                                                                                                |
| Metadata                       | `source` set to `pipedream`, and `record_id` set to the record’s id, so the status and reply webhooks for this text can find the record again. |
| Service                        | Auto, the default: iMessage when the person uses it, otherwise SMS through your iPhone.                                                        |

### Test it

Put your own number in **To** and press **Test**. A text arrives on your phone, and the step’s output shows the message. Then map Pipedream’s field back into **To**.

## Before you turn it on

- Text only people who asked to hear from you. Anyone who replies STOP goes on your stop list, and BlueBot cancels texts to them. [Stop words](https://usebluebot.com/docs/concepts/stop-words)
- A text that can’t go yet waits with a hold rather than failing: quiet hours, your Mac away, a daily limit. [Holds](https://usebluebot.com/docs/concepts/holds)
- [Pipedream with BlueBot](https://usebluebot.com/integrations/pipedream) on the integrations page says what else the two do together.
