> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.pipelaunch.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Automate your custom workflow by automatic executing a flow when a record is created or updated

This article will guide you through the steps on how to use a feature that allows you to run a flow after a record creation/update. This feature is especially useful when you have a custom workflow to automate. 
One common scenario is when you have a related object to the contact object and you want to prefill the values after a contact is created. We'll use this as an example to demonstrate how to write this object after a contact is created.

# Requirements

![Example of the Custom object related to the Contact Object](https://storage.crisp.chat/users/helpdesk/website/348acba567d60c00/image_e8nd8x.png)

![Sample flow](https://storage.crisp.chat/users/helpdesk/website/348acba567d60c00/image_1n89joq.png)

Flow with your custom workflow. In this case, we will define the code value and create a new record associated with a contact.

||| ⚠️Flow needs to have a variable of the type string/text with the name **recordId** 

![](https://storage.crisp.chat/users/helpdesk/website/348acba567d60c00/image_143rjfi.png)

| PipeLaunch supports both Autolaunched Flow and Screen Flows. Use an Autolaunched Flow if you don't need any user interaction

### Setup

* Go to **PipeLaunch Settings** > **Chrome Extension**
* Select your object (in this case we will use the Contact object)
* Add a New Flow

![](https://storage.crisp.chat/users/helpdesk/website/348acba567d60c00/image_rle7zf.png)

| Make sure that you type the exact Flow Api name

![](https://storage.crisp.chat/users/helpdesk/website/348acba567d60c00/image_12xr750.png)

* Enable the **Automatic Execution** and check the action **On Save**
* Click **Save**

### How to use

* Open LinkedIn and add a new Contact

![](https://storage.crisp.chat/users/helpdesk/website/348acba567d60c00/image_oqusb8.png)

* Click **Save**
* After the record is created, the flow is automatically loaded

![](https://storage.crisp.chat/users/helpdesk/website/348acba567d60c00/image_1b2wvz5.png)

* Define the flow values
![](https://storage.crisp.chat/users/helpdesk/website/348acba567d60c00/image_1isjl5r.png)

* The flow is closed after the execution and a new record is created 🎇

![](https://storage.crisp.chat/users/helpdesk/website/348acba567d60c00/image_1frfcu5.png)

# Troubleshooting

This feature can get stuck on an infinite loading screen in several ways, all related to Salesforce being unable to establish a connection to our servers from your local machine:
* because of your browser cookies preferences and local software setup
* because of your Salesforce CORS and trusted websites preferences
* because of your local IP or regional network restriction

### Browser preferences and local software
* **Top advice**: Go to [chrome://settings/cookies](chrome://settings/cookies) and make sure that the option "Block third-party cookies" is turned **off**
* Make sure to confirm that both [chrome://flags/#same-site-by-default-cookies](chrome://flags/#same-site-by-default-cookies) and [chrome://flags/#cookies-without-same-site-must-be-secure](chrome://flags/#cookies-without-same-site-must-be-secure) are disabled
* Any ad blocker must be turned off (especially free ones AdBlock, uBlock, Privacy Badger)  
* Please keep in mind that corporate antivirus/security software intercepting and blocking data might potentially have a false alarm for .salesforce.com JS files which are required to be downloaded (temporarily) to use the feature

### CORS
CORS issue can be easily discarded by visiting `Setup -> Security -> CORS` in Salesforce
Having installed PipeLaunch Salesforce package, you already automatically setup everything. You should see these allowed domains:

```
https://api-ce.pipelaunch.com
https://api.pipelaunch.com
https://plce.pipelaunch.com
```

### Local IP or regional network restrictions
* if you use a corporate laptop or Chrome browser account controlled by your organization, `BlockExternalExtensions` policy must be off and there should be no domain restrictions for PipeLaunch (see the list of approved domains above);
* if you are working in a corporate workplace or under a corporate VPN, it is highly advised to consult someone from your organization about IP, regional restrictions and corporate firewall. Our servers run on AWS eu-central-1 (Germany, Frankfurt)

If none of the above proved to be useful, feel free to reach out to us via help@pipelaunch.com. However, it is crucially important for you to attach a screenshot of your browser console (F12 or right mouse click -> inspect )

![Screenshot example](https://storage.crisp.chat/users/helpdesk/website/-/3/4/8/a/348acba567d60c00/unnamed_nemuva.png)