# Approaching your first process flow

## Introduction

The flexibility of **process flows** means that there's no 'one size fits all' approach - everyone's requirements are different, and the scope is huge. This level of flexibility is a great advantage but on the flip side - where do you start?&#x20;

Here, we outline the bare bones of a process flow so you know what to consider as a minimum when getting started for the first time.

## Testing

A scratchpad area will be available soon. In the meantime, we suggest registering for a sandbox account and experimenting there.&#x20;

Make sure you create instances with credentials for your third-party application sandbox accounts, rather than live ones!

## Key elements of a process flow

In their simplest form, process flows are defined to receive data from one third-party application and send it to another third-party application, perhaps with some data manipulation in between. Key elements are summarised below.

{% hint style="warning" %}
Process flows allow you to build highly complex flows with multiple routes and conditions. Here, we're considering an entry-level scenario to highlight key items as you get started with process flows.
{% endhint %}

<details>

<summary><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2Fu4hlSUN67apO4ByLzAe1%2F1.png?alt=media&#x26;token=21293c5f-14dd-4eca-b7f5-592abfe0a165" alt="" data-size="line"> Trigger</summary>

<img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2F0NKuYUBf4qRyzaBX4DMW%2Fshape_trigger.png?alt=media&#x26;token=135d4a29-6be1-4a9e-9643-acfa161ef417" alt="" data-size="original">

Every process flow starts with a trigger - when should this flow run? In process flows, trigger options are defined using the [trigger ](https://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/process-flow-shapes/standard-shapes/trigger-shape)shape.&#x20;

</details>

<details>

<summary><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2F83qvL3DjjvsmiVUYlQiQ%2F2.png?alt=media&#x26;token=dc06fd43-5913-462a-b256-101b3f76867e" alt="" data-size="line"> Data source</summary>

<img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2F4vlEdOAtcPndTHdGamxI%2Fshape_connection_1.png?alt=media&#x26;token=c82d70d5-f1f1-4b75-b2f5-65c85913fab4" alt="" data-size="original">

Consider the following:

* Which third-party application are you pulling data from?
* Have you [installed a connector](https://doc.wearepatchworks.com/product-documentation/connectors-and-instances/working-with-connectors/installing-a-connector) for this application?
* Have you [added an instance](https://doc.wearepatchworks.com/product-documentation/connectors-and-instances/working-with-instances/adding-an-instance) (or multiple instances) of this connector?

In process flows, a data source is defined by adding a [connection](https://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/process-flow-shapes/standard-shapes/connector-shape) shape and selecting a connector **instance** and **endpoint**.  &#x20;

</details>

<details>

<summary><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FVCQL42m29ZL1W1x3Q9aW%2F3.png?alt=media&#x26;token=7b70814f-ab70-4b5f-9cae-65c9dcf89da7" alt="" data-size="line"> Filters</summary>

![](https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FA8mslGBR6K4UHQL4wrYq%2Fshape_filter.png?alt=media\&token=7ea8d97f-65f0-4611-91a5-5d153282a9dc)

Do you need to refine data in the current payload, before it's processed any further? In process flows, filters are defined using the [filter](https://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/process-flow-shapes/standard-shapes/filter-shape) shape.  &#x20;

</details>

<details>

<summary><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2Fj27NPzQQFoRlKRDAmmsj%2F4.png?alt=media&#x26;token=482820e7-110b-4469-9da4-88339e687f6c" alt="" data-size="line"> Scripts</summary>

![](https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FRsilZ7reqFqGCas17qAE%2Fshape_script.png?alt=media\&token=839c01f3-72d9-4ce0-90a5-dc968dd1c919)

Does the data you pull (i.e. the payload) require advanced manipulation before processing continues? If it does, and you have development expertise in-house, you can write and apply [payload-level custom scripting](https://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/process-flow-shapes/advanced-shapes/script-shape).

In process flows, existing [payload-level custom scripts](https://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/broken-reference) are added using the [script](https://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/process-flow-shapes/advanced-shapes/script-shape) shape. This is an advanced feature - very often, standard [field mappings and transformations](#field-mappings) are enough to sync data as needed. &#x20;

</details>

<details>

<summary><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FxWO0mmwxJfEEmqcJZvM9%2F5.png?alt=media&#x26;token=72398fcd-7d39-4a4b-b718-36792c786dec" alt="" data-size="line"> Field mappings</summary>

![](https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2F0TbhmR2dU3YYh2deHgJ4%2Fshape_map.png?alt=media\&token=ebaa77e8-7fa3-4f3d-8eec-951c96f98932)

&#x20;Consider the following:

* Where should field values from the source data be placed in the destination application?
* Do you need to manipulate source field values before they are synced to the destination? If yes, will standard [field mapping transformation functions](https://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/process-flow-shapes/standard-shapes/map-shape/working-with-field-transformations/available-transform-functions) handle this - or are [field-level custom scripts](https://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/process-flow-shapes/standard-shapes/map-shape/working-with-field-transformations/available-transform-functions/other-transform-functions/script-transform-function) required?

In process flows, field mappings and (if required) [field-level custom scripts](https://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/process-flow-shapes/advanced-shapes/script-shape) are applied using the [map](https://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/process-flow-shapes/standard-shapes/map-shape) shape.&#x20;

</details>

<details>

<summary><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FPCaiaYtOfqGTkWgIFzrF%2F6.png?alt=media&#x26;token=2a400a71-222a-4a79-b3e3-59e4d3eb958d" alt="" data-size="line"> Data destination</summary>

![](https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FHC1ZOdII87g8KsaKEgtx%2Fshape_connection_2.png?alt=media\&token=16e5c200-0cfc-460a-85fc-09479685fcc9)

&#x20;Consider the following:

* Have you [installed a connector](https://doc.wearepatchworks.com/product-documentation/connectors-and-instances/working-with-connectors/installing-a-connector) for this/these application(s)?
* Have you [added an instance](https://doc.wearepatchworks.com/product-documentation/connectors-and-instances/working-with-instances/adding-an-instance) (or multiple instances) of this/these connector(s)?

In process flows, the data destination is defined by associating an instance with a [connection](https://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/process-flow-shapes/standard-shapes/connector-shape) shape. &#x20;

</details>

## Process flow versions

Process flow can be associated with three version types: draft, deployed and inactive. Before you get started building process flows, we advise reading our [Process flow versioning](https://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/process-flow-versioning) page to make sure you understand how this works.
