# Integrate GCP Cloud Functions and omni-channel automation with FlowBuilder

In this guide, you will learn how to Integrate GCP Cloud Functions and omni-channel automation with MessageBird’s FlowBuilder. This tutorial covers the setup of an OTP generator using Cloud Functions — as well as integration into a user-initiated Omni-Channel flow.

&#x20;

<figure><img src="/files/JnscDHtxUlN8Z9YdXSet" alt=""><figcaption></figcaption></figure>

**2FA for Voice and WhatsApp**

We’ll learn how to create a Cloud Function for generating OTP passcodes and use it to authenticate users’ access across any omni-channel service.&#x20;

&#x20;

**Why Cloud Functions?**<br>

**Cloud Functions** works as a connective layer allowing you to weave logic between GCP services and third-party platforms by listening and responding to events. With just a few lines of code, developers can enrich their use of any services and create high-level combinations without the need to provision or manage servers.

&#x20;

**Requirements**

* [A MessageBird account](https://dashboard.messagebird.com/en/sign-up)
* [A WhatsApp for Business account](https://www.messagebird.com/whatsapp/)
* [Google Cloud Platform - GCP](https://cloud.google.com/free)

&#x20;

**Step 1: Sign up for GCP**

Make sure to sign up for a [MessageBird account](https://dashboard.messagebird.com/en/sign-up) and a [WhatsApp for Business account](https://www.messagebird.com/whatsapp/). Done? Awesome! Time to [sign up for GCP](https://cloud.google.com/free).&#x20;

1\. Complete free [GCP account signup](https://cloud.google.com/free)

2\. Create a [Cloud function](https://cloud.google.com/functions/docs/quickstart-console) by following these steps:&#x20;

* Open the [Functions Overview page](https://console.cloud.google.com/functions/list?_ga=2.178142822.277010062.1589934721-1232490777.1580424491) in the Cloud Console and make sure that the project for which you enabled Cloud Functions is selected.
* Choose **Create function**.
* **Name** your function.
* Select **HTTP Trigger** from the trigger field
* Record the **URL** of the function
* Choose **Allow Unauthenticated Invocations** — this is for initial testing only.
* In the source code field, select **Inline editor**. In this tutorial, we’ll use the default function provided by the editor.&#x20;
* Use the Runtime dropdown and select **Node.js 8**
* **Overwrite Index.js** with [this content](https://drive.google.com/open?id=1vlfkKeY2qzLDAh_2LP9wLIu_I_Z9CbpS)**.**

Ready? When you finish these steps, your display should resemble the following:

&#x20;

<figure><img src="/files/KjBKERWFhsfMNFJCtedC" alt=""><figcaption></figcaption></figure>

&#x20;

&#x20;

3\. And that’s it! Now just **deploy** the function

&#x20;

**Step 2: Connect it all in the MessageBird Dashboard**

1\. Log in to your [MessageBird Dashboard](https://dashboard.messagebird.com/en/login) and go to [Flow Builder](https://dashboard.messagebird.com/en/flow-builder).

2\. Import the [sample flow](https://drive.google.com/open?id=1O_hJIqyOS6n2Js4zdyFb0o3QbfCezvfi).

3\. Select **WhatsApp** as the trigger of your flow.

4\. Look for steps **Cloud Function 1/2** and **2/2**, and replace the URL with the newly created **Cloud Function URL**.

5\. If you are looking to provide voice 2FA, simply [purchase a MessageBird Number](https://dashboard.messagebird.com/en/numbers). If this is not the case, please remove the **phone verification branch** from your flow.&#x20;

6\. **Publish** your flow in the top right corner of your screen, and you're good to go!&#x20;

7\. Done! Initiate a conversation with your channel to start authenticating your customers.

And that’s it! 🎉 Now you know how to integrate GCP Cloud Functions and omni-channel automation with FlowBuilder.

&#x20;

&#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bird.com/connectivity-platform/advanced-functionalities/integrate-gcp-cloud-functions-and-omni-channel-automation-with-flowbuilder.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
