# Create a flow

{% hint style="info" %}
Example is "Add new contacts from HubSpot to the email list in Mailchimp"
{% endhint %}

### Create Flow and Webhook

<figure><img src="https://1809556891-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNmASc52mbS5BH4kcxCHP%2Fuploads%2FH06fWEUUkyOlAUDfGdVg%2Fimage.png?alt=media&#x26;token=ee7de357-5815-49cd-bce1-7f667c721ff7" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1809556891-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNmASc52mbS5BH4kcxCHP%2Fuploads%2FOtL1ksclSUbkUYSvBnuK%2Fimage.png?alt=media&#x26;token=a4efd523-9547-45cf-890c-fc6285d546be" alt=""><figcaption></figcaption></figure>

Copy webhook url.

<figure><img src="https://1809556891-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNmASc52mbS5BH4kcxCHP%2Fuploads%2FO0o4g0ZSu4hCYsKW4kpl%2Fimage.png?alt=media&#x26;token=c2e74642-328b-47da-881c-abcea6faa953" alt=""><figcaption></figcaption></figure>

Complete the settings in the hubspot private app.

<figure><img src="https://1809556891-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNmASc52mbS5BH4kcxCHP%2Fuploads%2FJXfeEsMV8icbJJqxL4dg%2Fimage.png?alt=media&#x26;token=f580eee1-ed40-4b07-9ddf-db66940390de" alt=""><figcaption></figcaption></figure>

Make a test request to generate data schema.

### Config Flow

<figure><img src="https://1809556891-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNmASc52mbS5BH4kcxCHP%2Fuploads%2FM9AAilAoDGpXprFhlSHg%2Fimage.png?alt=media&#x26;token=ca7acddb-83d2-47f5-9678-889054d18255" alt=""><figcaption></figcaption></figure>

Add app node and choose hubspot.

<figure><img src="https://1809556891-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNmASc52mbS5BH4kcxCHP%2Fuploads%2Fi64i6gS665TXa7P7qtIW%2Fimage.png?alt=media&#x26;token=5030d77f-d339-4580-a4a3-02487d8cdcc3" alt=""><figcaption></figcaption></figure>

Choose Asset and Action, and set user id from webhook data.

<figure><img src="https://1809556891-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNmASc52mbS5BH4kcxCHP%2Fuploads%2FozREHE9NHJL1Mqga6D9a%2Fimage.png?alt=media&#x26;token=c649c234-2b5c-4d75-b12e-763ec4e74492" alt=""><figcaption></figcaption></figure>

Make a test request, now we can use the user ID in webhook to query the user's email address.

<figure><img src="https://1809556891-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNmASc52mbS5BH4kcxCHP%2Fuploads%2FrZ3xbleQosM7WL2EEtxp%2Fimage.png?alt=media&#x26;token=30141f4a-63a7-4feb-b572-10e4ea3dbd04" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1809556891-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNmASc52mbS5BH4kcxCHP%2Fuploads%2F2uVkQ9MuW1phXrFIAdv3%2Fimage.png?alt=media&#x26;token=9b0fa5a2-ce75-47a0-a065-6ea507a740c8" alt=""><figcaption></figcaption></figure>

Add mailchump app, config assets with mailchump api\_key.

Choose "create\_member" action and set email data from dynamic parameters.

### Test

<figure><img src="https://1809556891-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNmASc52mbS5BH4kcxCHP%2Fuploads%2FxIcgBH0JHTt2qw8SxMQB%2Fimage.png?alt=media&#x26;token=44ea9bff-5701-4c5f-84a4-2446809a8dd4" alt=""><figcaption></figcaption></figure>

Now that the flow configuration is complete, let's actually test the functionality.

Create contact on hubspot, then webhook will call.

<figure><img src="https://1809556891-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNmASc52mbS5BH4kcxCHP%2Fuploads%2FaZ264NTpikQuJu9BZX0b%2Fimage.png?alt=media&#x26;token=208be1d6-4410-468a-8284-ed0a432e41b8" alt=""><figcaption></figcaption></figure>

In audit logs, we can see that the flow execution was successful.

<figure><img src="https://1809556891-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNmASc52mbS5BH4kcxCHP%2Fuploads%2Flv8xvQmz66yuE5matihJ%2Fimage.png?alt=media&#x26;token=10f28f04-2302-44b5-a85c-0380051562a7" alt=""><figcaption></figcaption></figure>

Check if the member was successfully created in mailchump.

<figure><img src="https://1809556891-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNmASc52mbS5BH4kcxCHP%2Fuploads%2FQVYarKdSyN15wzyZkmLh%2Fimage.png?alt=media&#x26;token=98fac811-ebca-498f-9b2d-71e2ee29fe70" alt="" width="321"><figcaption></figcaption></figure>

Congratulations！ The flow is ready to use.
