# Use workflows to import data

> Kustomer offers a variety of ways to import additional data into our platform. For example, you may want to import customer lists, past orders, past conversa...

Source: https://support.kustomer.com/en_us/importing-data-into-kustomer-SkoeDxhfM

Last updated: 2024-09-24T21:20:20.791Z

Kustomer offers a variety of ways to import additional data into our platform. For example, you may want to import customer lists, past orders, past conversations, users, or even new conversations from a contact form on your website.

In this article, you'll learn about using one of Kustomer's most powerful features, Workflows, to bring your data into Kustomer. Workflows are an advanced Kustomer feature that allow you to build automations that activate whenever a specified event occurs in Kustomer or any connected app.

Kustomer also offers a less technical import method called Data Connect, which is a guided setup wizard that captures data through a webhook without having to set up a workflow. Learn more about this in our help article for [Data Connect](https://help.kustomer.com/data-connect-Byt82GQDt).

**Who can access this feature?**

**User types**

Admins can configure workflows.

  

### In this article

*   [What are workflows?](#Workflows)
*   [What are hooks?](#Hooks)
*   [Why import data?](#WhyImport)
*   [Step 1. Create a webhook to use in your workflow](#Step1)
*   [Step 2. Create a workflow to import data](#Step2)
*   [Step 3. Send data to Kustomer](#Step3)
*   [Step 4. Build out the workflow to import data into customers' timelines](#Step4)

### What are workflows?

Workflows can import data into Kustomer using web, form, and email hooks. Post your data to a webhook, form hook, or email it to an email hook. Then, set up the rest of the workflow to process the data in Kustomer. Workflows in Kustomer represent a set of defined rules used to automate processes.

### What are hooks?

Hooks are a flexible way for 3rd party applications to sync data with Kustomer. There are three types of hooks available in Kustomer, and each has unique attributes:

*   **Webhooks** are a URL that provides a way for an application to send Kustomer real-time information. This requires the application to POST data to the webhook URL so Kustomer can read the data. Posting to a Kustomer webhook requires a Kustomer API key with `org.hook` permission.
*   **Form hooks** are similar to a webhook, a URL that provides a way for an application to send Kustomer real-time information. This requires the application to post data to the form hook URL so Kustomer can read the data. Posting to a Kustomer form hook does not require an API key.
*   **Email hooks** provide a way to email real-time information to Kustomer via a unique email address.

### Why import data?

Common use cases for importing data into Kustomer include:

*   Sending data from your website's _Contact Us_ form. To do this, you would create a form hook and configure your _Contact Us_ form to POST to it. Then, you would set up a Workflow to ingest the data from the form hook, and create a new conversation in Kustomer to represent the data sent from the Contact Us form.
*   Sending data from your admin system to create or update customers in Kustomer
*   Sending data from your admin system to create an order in a customer's timeline in Kustomer. You could achieve this by creating a webhook and configuring your admin system to POST data you want to see in Kustomer to the webhook. A webhook requires a Kustomer API key to make sensitive customer information is securely transferred. Set up a workflow to ingest the data from your admin system. Use this data to create a new order object in your customer's timeline.

### Step 1. Create a webhook to use in your workflow

First, we'll need to create a new hook.

1.  In Kustomer, go to **Settings**![](https://cdn.kustomerhostedcontent.com/media/570fad9d9001bc1000163b28/beb3997d6d82cc51780081fb49416a39.png)and select **Platform > Inbound Webhooks**.
2.  Select **Add Inbound Webhook**.
3.  Fill out the **name** and **description** of the new webhook.  
    
    **Note:** We always recommend as a best practice that you use clear and illustrative names and descriptions, so that it's easy to know what function this webhook performs if another member of your team reviews it at a later date.
    
4.  Select your choice between creating a web, form, or email hook based upon your needs.
5.  Then, select **Create** to save the new webhook.

### Step 2. Create a workflow to import data

Next, we will create the workflow itself.

1.  Go to **Settings![](https://cdn.kustomerhostedcontent.com/media/570fad9d9001bc1000163b28/beb3997d6d82cc51780081fb49416a39.png)**and select **Platform >** **Workflows.** 
2.  Select **Add Workflow**, then select **Custom Workflow**.
3.  Give your workflow a **name** and **description** so it's easy to reference later, then select **Create**.
4.  Select your newly-created webhook as the workflow's Trigger Event.

### Step 3. Send data to Kustomer

This workflow will run whenever its defined trigger event is triggered. In our example, we will choose Hooks as the _Trigger App_ and a hook as a _Trigger Event_.

Configure your system to make an `HTTP POST` request to the webhook URL and send along any data you'd like to see in Kustomer. For example, if you'd like to see a customer's order in their Kustomer timeline, send the order data payload to the webhook URL. Remember to include a Kustomer API token with `org.hook` permissions when posting to a Kustomer webhook.

Review the [Example Data Payloads](https://kustomer.kustomer.help/en_us/example-data-payloads-rkSiyZs3E) article to reference what a data payload coming into Kustomer would look like.

### Step 4. Build out the workflow to import data into customers' timelines

Now that you're sending data to a Kustomer webhook, it's time to build out the rest of your workflow to manage how the data is represented in Kustomer. The workflow will look something like this:

![](https://support.kustomer.com/images/ImportDataWF.png)

This workflow will run whenever the _Admin-Import-Order_ hook is triggered, meaning it has received data. After receiving data from the webhook, the workflow finds the customer by email. To do this, it uses information sent over to the webhook, which can be accessed by the workflow using the following syntax:

`/#steps.1.attributes.data`

We can drill down to the customer email we sent over to the webhook using the following syntax:

`/#steps.1.attributes.data.customer.email`

The action step _Customer Find By Email_ will either return a customer in your Kustomer org or not find that customer by their email. 

**Note:** Sometimes you may have a customer in Kustomer without an email. To handle these cases, workflows also have action steps, _Customer Find By Phon_e and _Customer Find By External Id_.

To handle each case we use condition steps like _Customer Exists_ and _Customer DNE_.

If the customer exists, the workflow uses action step _KObject Create With Customer_ to create a custom object (KObject) in the customer's timeline with the data sent over to the webhook. 

**Note:** You'll need to have already created a KObject in your Kustomer organization to reference in this step as _KlassName_. To create a KObject, create a new Klass (KObject) in **Settings![](https://cdn.kustomerhostedcontent.com/media/570fad9d9001bc1000163b28/beb3997d6d82cc51780081fb49416a39.png) > Klasses.** You can also design the look of your KObject by in the **Timeline Layout** or **Insight Card** tabs.

If the customer does not exist in your Kustomer organization, then the Workflow uses action step _Customer Create_ to first create the customer and uses _KObject Create With Customer_ to create the KObject in the newly created customer's timeline.

That's all you need to import data into Kustomer. There are many different ways to handle imported data. Customize your workflows to create and update customers, to create and update orders, or anything else you'd like to see in Kustomer. 

### Related Topics

*   [Workflows Overview](https://help.kustomer.com/workflows-overview-HJFVTZhzz)
*   [Inbound Webhooks](https://help.kustomer.com/inbound-webhooks-Bkqc1z3fM)
*   [Data Connect](https://help.kustomer.com/data-connect-Byt82GQDt)
