Skip to content
Workflows

Workflow Action - Custom Code

TABLE OF CONTENTS What is Custom Code? How it works 1. Add Action 2. Programming Language 3. Property to be included in code 4. Code Editor 5. Enhanced…

5 min read1,137 words21 explained images
View as markdownOpen in ClaudeOpen in ChatGPT
Each image has a one line explanation. Switch to full detail for the step it belongs to, the fields and buttons involved, examples and the whole procedure.
On this page
  1. 1. Add Action
  2. 2. Programming Language
  3. 3. Property to be included in code
  4. 4. Code Editor
  5. 5. Enhanced console support
  6. 6. External HTTP Request
  7. 7. Format Code
  8. 8. Test your Code
  9. Custom Code AI

Video 1 Open in a new tab

TABLE OF CONTENTS

What is Custom Code?

Custom Code is a powerful tool that will allow users to create custom logic they want to achieve and are not available currently. This provides flexibility and control beyond the pre-built actions, enabling users to automate complex tasks and integrate with various services not natively supported. This is a Premium Action.

How it works

1. Add Action

  • In the workflows select the "+" icon to add an action and search for "Custom Code".


1. Add Action (image 1 of 21) What this shows In the workflows select the "+" icon to add an action and search for "Custom Code". What this shows Illustrates the "1. Add Action" section of "Workflow Action - Custom Code". This screenshot appears in the "1. Add Action" section of "Workflow Action - Custom Code". The text alongside this image reads: In the workflows select the "+" icon to add an action and search for "Custom Code". Immediately after, the guide continues: The code can be written in JavaScript. This will be the default language selected. Image 1 of 21 What to chooseIn the workflows select the "+" icon to add an action and search for "Custom Code". Next stepThe code can be written in JavaScript. This will be the default language selected.

2. Programming Language

  • The code can be written in JavaScript. This will be the default language selected.
2. Programming Language (image 2 of 21) What this shows The code can be written in JavaScript. What this shows Illustrates the "2. Programming Language" section of "Workflow Action - Custom Code". This screenshot appears in the "2. Programming Language" section of "Workflow Action - Custom Code". The text alongside this image reads: The code can be written in JavaScript. This will be the default language selected. Immediately after, the guide continues: Now what if there are values in the triggers or actions above the custom code and you want to use them in the code. That's where this field comes to use. These fields allow us to reference values from previous steps in our code by adding…. Image 2 of 21 What this coversThe code can be written in JavaScript. This will be the default language selected. Next stepNow what if there are values in the triggers or actions above the custom code and you want to use them in the code. That's where this field comes to use. These fields allow us to reference values from previous steps in our code by adding them to a dictionary called InputData. You can enter the Key in the "Key" input field and assign a value to it by selecting the value through the custom value picker. You can add multiple properties by clicking on "Add Property" For example, if a trigger gives us information about a customer, which we then need to manipulate, we can add their name to the Input Data fields and reference it with i inputData.keyName or inputData['keyName']

3. Property to be included in code

  •  Now what if there are values in the triggers or actions above the custom code and you want to use them in the code. That's where this field comes to use.
  • These fields allow us to reference values from previous steps in our code by adding them to a dictionary called InputData.
  • You can enter the Key in the "Key" input field and assign a value to it by selecting the value through the custom value picker.
  • You can add multiple properties by clicking on "Add Property"
  • For example, if a trigger gives us information about a customer, which we then need to manipulate, we can add their name to the Input Data fields and reference it with iinputData.keyName or inputData['keyName']
3. Property to be included in code (image 3 of 21) What this shows Now what if there are values in the triggers or actions above the custom code and you want to use them in the code. What this shows Illustrates the "3. Property to be included in code" section of "Workflow Action - Custom Code". This screenshot appears in the "3. Property to be included in code" section of "Workflow Action - Custom Code". The text alongside this image reads: Now what if there are values in the triggers or actions above the custom code and you want to use them in the code. That's where this field comes to use. These fields allow us to reference values from previous steps in our code by adding them to a dictionary called InputData. You can enter the Key…. Immediately after, the guide continues: You can write the code in the Code Editor A sample code is pre populated for your reference. Output should also be written in the code formatter itself. Output should be a JavaScript Object or Array of Objects. Image 3 of 21 What to fill inNow what if there are values in the triggers or actions above the custom code and you want to use them in the code. That's where this field comes to use. These fields allow us to reference values from previous steps in our code by adding them to a dictionary called InputData. You can enter the Key in the "Key" input field and assign a value to it by selecting the value through the custom value picker. You can add multiple properties by clicking on "Add Property" For example, if a trigger gives us information about a customer, which we then need to manipulate, we can add their name to the Input Data fields and reference it with i inputData.keyName or inputData['keyName'] Next stepYou can write the code in the Code Editor A sample code is pre populated for your reference. Output should also be written in the code formatter itself. Output should be a JavaScript Object or Array of Objects.
All 5 steps in this procedure
  1. Now what if there are values in the triggers or actions above the custom code and you want to use them in the code. That's where this field comes to use.
  2. These fields allow us to reference values from previous steps in our code by adding them to a dictionary called InputData.
  3. You can enter the Key in the "Key" input field and assign a value to it by selecting the value through the custom value picker.
  4. You can add multiple properties by clicking on "Add Property"
  5. For example, if a trigger gives us information about a customer, which we then need to manipulate, we can add their name to the Input Data fields and reference it with i inputData.keyName or inputData['keyName']

4. Code Editor

  • You can write the code in the Code Editor
  • A sample code is pre populated for your reference.
  • Output should also be written in the code formatter itself.
  • Output should be a JavaScript Object or Array of Objects.
4. Code Editor (image 4 of 21) What this shows You can write the code in the Code Editor A sample code is pre populated for your reference. What this shows Illustrates the "4. Code Editor" section of "Workflow Action - Custom Code". This screenshot appears in the "4. Code Editor" section of "Workflow Action - Custom Code". The text alongside this image reads: You can write the code in the Code Editor A sample code is pre populated for your reference. Output should also be written in the code formatter itself. Output should be a JavaScript Object or Array of Objects. This part of the guide covers 1 field, listed below. Immediately after, the guide continues: This feature captures and logs all console.log outputs from user code, allowing user to debug and monitor the code more effectively. Image 4 of 21 What this coversYou can write the code in the Code Editor A sample code is pre populated for your reference. Output should also be written in the code formatter itself. Output should be a JavaScript Object or Array of Objects.
Fields in this part of the guide You can write the code in the Code Editor
Next stepThis feature captures and logs all console.log outputs from user code, allowing user to debug and monitor the code more effectively.
All 4 steps in this procedure
  1. You can write the code in the Code Editor
  2. A sample code is pre populated for your reference.
  3. Output should also be written in the code formatter itself.
  4. Output should be a JavaScript Object or Array of Objects.

5. Enhanced console support

This feature captures and logs all console.log outputs from user code, allowing user to debug and monitor the code more effectively.

5. Enhanced console support (image 5 of 21) What this shows This feature captures and logs all console.log outputs from user code, allowing user to debug and monitor the code more effectively. What this shows Illustrates the "5. Enhanced console support" section of "Workflow Action - Custom Code". This screenshot appears in the "5. Enhanced console support" section of "Workflow Action - Custom Code". The text alongside this image reads: This feature captures and logs all console.log outputs from user code, allowing user to debug and monitor the code more effectively. Immediately after, the guide continues: Custom code supports external HTTP requests Click on "HTTP Request" button above the code editor Select from the following - The selected request will populate at the bottom in the code editor. Image 5 of 21 What this coversThis feature captures and logs all console.log outputs from user code, allowing user to debug and monitor the code more effectively. Next stepCustom code supports external HTTP requests Click on "HTTP Request" button above the code editor Select from the following - The selected request will populate at the bottom in the code editor

6. External HTTP Request

  • Custom code supports external HTTP requests
  • Click on "HTTP Request" button above the code editor
  • Select from the following -
    • Get Method
    • Post Method
    • Put Method
    • Patch Method
    • Delete Method
    • Head Method
    • Options Method
  • The selected request will populate at the bottom in the code editor
6. External HTTP Request (image 6 of 21) What this shows Custom code supports external HTTP requests Click on "HTTP Request" button above the code editor Select from the following - The selected… What this shows Illustrates the "6. External HTTP Request" section of "Workflow Action - Custom Code". This screenshot appears in the "6. External HTTP Request" section of "Workflow Action - Custom Code". The text alongside this image reads: Custom code supports external HTTP requests Click on "HTTP Request" button above the code editor Select from the following - The selected request will populate at the bottom in the code editor. This part of the guide covers 6 fields, listed below. Immediately after, the guide continues: You can also format the code. Use the "Format Code" button in the bottom of the code editor to change the code into more readable format. Properly formatted code is easier to read and understand. For instance, consistent indentation…. Image 6 of 21 What to chooseCustom code supports external HTTP requests Click on "HTTP Request" button above the code editor Select from the following - The selected request will populate at the bottom in the code editor
Fields in this part of the guide Custom code supports external HTTP requestsGet MethodPost MethodPut MethodPatch MethodOptions Method
Next stepYou can also format the code. Use the "Format Code" button in the bottom of the code editor to change the code into more readable format. Properly formatted code is easier to read and understand. For instance, consistent indentation, spacing, and line breaks help identify code blocks, functions, or sections of a document.
All 4 steps in this procedure
  1. Custom code supports external HTTP requests
  2. Click on "HTTP Request" button above the code editor
  3. Select from the following -
  4. The selected request will populate at the bottom in the code editor
6. External HTTP Request (image 7 of 21) What this shows Custom code supports external HTTP requests Click on "HTTP Request" button above the code editor Select from the following - The selected… What this shows Illustrates the "6. External HTTP Request" section of "Workflow Action - Custom Code". This screenshot appears in the "6. External HTTP Request" section of "Workflow Action - Custom Code". The text alongside this image reads: Custom code supports external HTTP requests Click on "HTTP Request" button above the code editor Select from the following - The selected request will populate at the bottom in the code editor. This part of the guide covers 6 fields, listed below. Immediately after, the guide continues: You can also format the code. Use the "Format Code" button in the bottom of the code editor to change the code into more readable format. Properly formatted code is easier to read and understand. For instance, consistent indentation…. Image 7 of 21 What to chooseCustom code supports external HTTP requests Click on "HTTP Request" button above the code editor Select from the following - The selected request will populate at the bottom in the code editor
Fields in this part of the guide Custom code supports external HTTP requestsGet MethodPost MethodPut MethodPatch MethodOptions Method
Next stepYou can also format the code. Use the "Format Code" button in the bottom of the code editor to change the code into more readable format. Properly formatted code is easier to read and understand. For instance, consistent indentation, spacing, and line breaks help identify code blocks, functions, or sections of a document.
All 4 steps in this procedure
  1. Custom code supports external HTTP requests
  2. Click on "HTTP Request" button above the code editor
  3. Select from the following -
  4. The selected request will populate at the bottom in the code editor
6. External HTTP Request (image 8 of 21) What this shows Custom code supports external HTTP requests Click on "HTTP Request" button above the code editor Select from the following - The selected… What this shows Illustrates the "6. External HTTP Request" section of "Workflow Action - Custom Code". This screenshot appears in the "6. External HTTP Request" section of "Workflow Action - Custom Code". The text alongside this image reads: Custom code supports external HTTP requests Click on "HTTP Request" button above the code editor Select from the following - The selected request will populate at the bottom in the code editor. This part of the guide covers 6 fields, listed below. Immediately after, the guide continues: You can also format the code. Use the "Format Code" button in the bottom of the code editor to change the code into more readable format. Properly formatted code is easier to read and understand. For instance, consistent indentation…. Image 8 of 21 What to chooseCustom code supports external HTTP requests Click on "HTTP Request" button above the code editor Select from the following - The selected request will populate at the bottom in the code editor
Fields in this part of the guide Custom code supports external HTTP requestsGet MethodPost MethodPut MethodPatch MethodOptions Method
Next stepYou can also format the code. Use the "Format Code" button in the bottom of the code editor to change the code into more readable format. Properly formatted code is easier to read and understand. For instance, consistent indentation, spacing, and line breaks help identify code blocks, functions, or sections of a document.
All 4 steps in this procedure
  1. Custom code supports external HTTP requests
  2. Click on "HTTP Request" button above the code editor
  3. Select from the following -
  4. The selected request will populate at the bottom in the code editor

7. Format Code

  • You can also format the code. Use the "Format Code" button in the bottom of the code editor to change the code into more readable format. 
  • Properly formatted code is easier to read and understand.
  • For instance, consistent indentation, spacing, and line breaks help identify code blocks, functions, or sections of a document.
7. Format Code (image 9 of 21) What this shows You can also format the code. What this shows Illustrates the "7. Format Code" section of "Workflow Action - Custom Code". This screenshot appears in the "7. Format Code" section of "Workflow Action - Custom Code". The text alongside this image reads: You can also format the code. Use the "Format Code" button in the bottom of the code editor to change the code into more readable format. Properly formatted code is easier to read and understand. For instance, consistent indentation, spacing, and line breaks help identify code blocks, functions…. Immediately after, the guide continues: Testing the code is a mandatory step, if the test is not done then user will not be able to use the output of the code in the subsequent steps. To test the code click on the "Test your Code" button. When you click on the button a new pop…. Image 9 of 21 What this coversYou can also format the code. Use the "Format Code" button in the bottom of the code editor to change the code into more readable format. Properly formatted code is easier to read and understand. For instance, consistent indentation, spacing, and line breaks help identify code blocks, functions, or sections of a document. Next stepTesting the code is a mandatory step, if the test is not done then user will not be able to use the output of the code in the subsequent steps. To test the code click on the "Test your Code" button. When you click on the button a new pop up will open where you can run the test. There can be 2 scenarios, first where you have added properties and second where you have not. In case there are properties are added you can enter the sample values in the "Test Setup" tab and test the Response. In case there are no properties added, you can directly check the response. Click on the "Test your Code" button to check the response. Post clicking on the test button, if there are no errors in the code them it will show " Test Result Success " and if there is an error in code then the result will be " Test Res ult Failed" and you would have to recheck the code to remove the error.
All 3 steps in this procedure
  1. You can also format the code. Use the "Format Code" button in the bottom of the code editor to change the code into more readable format.
  2. Properly formatted code is easier to read and understand.
  3. For instance, consistent indentation, spacing, and line breaks help identify code blocks, functions, or sections of a document.

8. Test your Code

  • Testing the code is a mandatory step, if the test is not done then user will not be able to use the output of the code in the subsequent steps.
  • To test the code click on the "Test your Code" button.
  • When you click on the button a new pop up will open where you can run the test.
  • There can be 2 scenarios, first where you have added properties and second where you have not.
  • In case there are properties are added you can enter the sample values in the "Test Setup" tab and test the Response.
  • In case there are no properties added, you can directly check the response.
  • Click on the "Test your Code" button to check the response.
  • Post clicking on the test button, if there are no errors in the code them it will show "Test Result Success" and if there is an error in code then the result will be "Test Result Failed" and you would have to recheck the code to remove the error.
8. Test your Code (image 10 of 21) What this shows Testing the code is a mandatory step, if the test is not done then user will not be able to use the output of the code in the subsequent steps. What this shows Illustrates the "8. Test your Code" section of "Workflow Action - Custom Code". This screenshot appears in the "8. Test your Code" section of "Workflow Action - Custom Code". The text alongside this image reads: Testing the code is a mandatory step, if the test is not done then user will not be able to use the output of the code in the subsequent steps. To test the code click on the "Test your Code" button. When you click on the button a new pop up will open where you can run the test. There can be 2…. Immediately after, the guide continues: 9. Check Input Values in Execution logs. Image 10 of 21 What to fill inTesting the code is a mandatory step, if the test is not done then user will not be able to use the output of the code in the subsequent steps. To test the code click on the "Test your Code" button. When you click on the button a new pop up will open where you can run the test. There can be 2 scenarios, first where you have added properties and second where you have not. In case there are properties are added you can enter the sample values in the "Test Setup" tab and test the Response. In case there are no properties added, you can directly check the response. Click on the "Test your Code" button to check the response. Post clicking on the test button, if there are no errors in the code them it will show " Test Result Success " and if there is an error in code then the result will be " Test Res ult Failed" and you would have to recheck the code to remove the error.
Buttons and menus referenced 9. Check Input Values in Execution logsCustom Code AI
Next step9. Check Input Values in Execution logs
All 8 steps in this procedure
  1. Testing the code is a mandatory step, if the test is not done then user will not be able to use the output of the code in the subsequent steps.
  2. To test the code click on the "Test your Code" button.
  3. When you click on the button a new pop up will open where you can run the test.
  4. There can be 2 scenarios, first where you have added properties and second where you have not.
  5. In case there are properties are added you can enter the sample values in the "Test Setup" tab and test the Response.
  6. In case there are no properties added, you can directly check the response.
  7. Click on the "Test your Code" button to check the response.
  8. Post clicking on the test button, if there are no errors in the code them it will show " Test Result Success " and if there is an error in code then the result will be " Test Res ult Failed" and you would have to recheck the code to remove the error.
8. Test your Code (image 11 of 21) What this shows Testing the code is a mandatory step, if the test is not done then user will not be able to use the output of the code in the subsequent steps. What this shows Illustrates the "8. Test your Code" section of "Workflow Action - Custom Code". This screenshot appears in the "8. Test your Code" section of "Workflow Action - Custom Code". The text alongside this image reads: Testing the code is a mandatory step, if the test is not done then user will not be able to use the output of the code in the subsequent steps. To test the code click on the "Test your Code" button. When you click on the button a new pop up will open where you can run the test. There can be 2…. Immediately after, the guide continues: 9. Check Input Values in Execution logs. Image 11 of 21 What to fill inTesting the code is a mandatory step, if the test is not done then user will not be able to use the output of the code in the subsequent steps. To test the code click on the "Test your Code" button. When you click on the button a new pop up will open where you can run the test. There can be 2 scenarios, first where you have added properties and second where you have not. In case there are properties are added you can enter the sample values in the "Test Setup" tab and test the Response. In case there are no properties added, you can directly check the response. Click on the "Test your Code" button to check the response. Post clicking on the test button, if there are no errors in the code them it will show " Test Result Success " and if there is an error in code then the result will be " Test Res ult Failed" and you would have to recheck the code to remove the error.
Buttons and menus referenced 9. Check Input Values in Execution logsCustom Code AI
Next step9. Check Input Values in Execution logs
All 8 steps in this procedure
  1. Testing the code is a mandatory step, if the test is not done then user will not be able to use the output of the code in the subsequent steps.
  2. To test the code click on the "Test your Code" button.
  3. When you click on the button a new pop up will open where you can run the test.
  4. There can be 2 scenarios, first where you have added properties and second where you have not.
  5. In case there are properties are added you can enter the sample values in the "Test Setup" tab and test the Response.
  6. In case there are no properties added, you can directly check the response.
  7. Click on the "Test your Code" button to check the response.
  8. Post clicking on the test button, if there are no errors in the code them it will show " Test Result Success " and if there is an error in code then the result will be " Test Res ult Failed" and you would have to recheck the code to remove the error.
8. Test your Code (image 12 of 21) What this shows Testing the code is a mandatory step, if the test is not done then user will not be able to use the output of the code in the subsequent steps. What this shows Illustrates the "8. Test your Code" section of "Workflow Action - Custom Code". This screenshot appears in the "8. Test your Code" section of "Workflow Action - Custom Code". The text alongside this image reads: Testing the code is a mandatory step, if the test is not done then user will not be able to use the output of the code in the subsequent steps. To test the code click on the "Test your Code" button. When you click on the button a new pop up will open where you can run the test. There can be 2…. Immediately after, the guide continues: 9. Check Input Values in Execution logs. Image 12 of 21 What to fill inTesting the code is a mandatory step, if the test is not done then user will not be able to use the output of the code in the subsequent steps. To test the code click on the "Test your Code" button. When you click on the button a new pop up will open where you can run the test. There can be 2 scenarios, first where you have added properties and second where you have not. In case there are properties are added you can enter the sample values in the "Test Setup" tab and test the Response. In case there are no properties added, you can directly check the response. Click on the "Test your Code" button to check the response. Post clicking on the test button, if there are no errors in the code them it will show " Test Result Success " and if there is an error in code then the result will be " Test Res ult Failed" and you would have to recheck the code to remove the error.
Buttons and menus referenced 9. Check Input Values in Execution logsCustom Code AI
Next step9. Check Input Values in Execution logs
All 8 steps in this procedure
  1. Testing the code is a mandatory step, if the test is not done then user will not be able to use the output of the code in the subsequent steps.
  2. To test the code click on the "Test your Code" button.
  3. When you click on the button a new pop up will open where you can run the test.
  4. There can be 2 scenarios, first where you have added properties and second where you have not.
  5. In case there are properties are added you can enter the sample values in the "Test Setup" tab and test the Response.
  6. In case there are no properties added, you can directly check the response.
  7. Click on the "Test your Code" button to check the response.
  8. Post clicking on the test button, if there are no errors in the code them it will show " Test Result Success " and if there is an error in code then the result will be " Test Res ult Failed" and you would have to recheck the code to remove the error.

9. Check Input Values in Execution logs

  • Now check the input values in the Execution logs also.
  • Go to the execution you want to check the values for and click on more details.
8. Test your Code (image 13 of 21) What this shows Now check the input values in the Execution logs also. What this shows Illustrates the "8. Test your Code" section of "Workflow Action - Custom Code". This screenshot appears in the "8. Test your Code" section of "Workflow Action - Custom Code". The text alongside this image reads: Now check the input values in the Execution logs also. Go to the execution you want to check the values for and click on more details. Immediately after, the guide continues: 10. R eturn a response directly from their custom code. Image 13 of 21 What to fill inNow check the input values in the Execution logs also. Go to the execution you want to check the values for and click on more details.
Buttons and menus referenced 9. Check Input Values in Execution logsCustom Code AI
Next step10. R eturn a response directly from their custom code.
All 8 steps in this procedure
  1. Testing the code is a mandatory step, if the test is not done then user will not be able to use the output of the code in the subsequent steps.
  2. To test the code click on the "Test your Code" button.
  3. When you click on the button a new pop up will open where you can run the test.
  4. There can be 2 scenarios, first where you have added properties and second where you have not.
  5. In case there are properties are added you can enter the sample values in the "Test Setup" tab and test the Response.
  6. In case there are no properties added, you can directly check the response.
  7. Click on the "Test your Code" button to check the response.
  8. Post clicking on the test button, if there are no errors in the code them it will show " Test Result Success " and if there is an error in code then the result will be " Test Res ult Failed" and you would have to recheck the code to remove the error.
8. Test your Code (image 14 of 21) What this shows Now check the input values in the Execution logs also. What this shows Illustrates the "8. Test your Code" section of "Workflow Action - Custom Code". This screenshot appears in the "8. Test your Code" section of "Workflow Action - Custom Code". The text alongside this image reads: Now check the input values in the Execution logs also. Go to the execution you want to check the values for and click on more details. Immediately after, the guide continues: 10. R eturn a response directly from their custom code. Image 14 of 21 What to fill inNow check the input values in the Execution logs also. Go to the execution you want to check the values for and click on more details.
Buttons and menus referenced 9. Check Input Values in Execution logsCustom Code AI
Next step10. R eturn a response directly from their custom code.
All 8 steps in this procedure
  1. Testing the code is a mandatory step, if the test is not done then user will not be able to use the output of the code in the subsequent steps.
  2. To test the code click on the "Test your Code" button.
  3. When you click on the button a new pop up will open where you can run the test.
  4. There can be 2 scenarios, first where you have added properties and second where you have not.
  5. In case there are properties are added you can enter the sample values in the "Test Setup" tab and test the Response.
  6. In case there are no properties added, you can directly check the response.
  7. Click on the "Test your Code" button to check the response.
  8. Post clicking on the test button, if there are no errors in the code them it will show " Test Result Success " and if there is an error in code then the result will be " Test Res ult Failed" and you would have to recheck the code to remove the error.

10. Return a response directly from their custom code.

Key Benefits:

  • This improvement allows for a more streamlined coding experience, making it easier to write, debug, and manage custom asynchronous code.
  • This new capability simplifies handling asynchronous operations and improves the overall efficiency of custom scripts.
8. Test your Code (image 15 of 21) What this shows This improvement allows for a more streamlined coding experience, making it easier to write, debug, and manage custom asynchronous code. What this shows Illustrates the "8. Test your Code" section of "Workflow Action - Custom Code". This screenshot appears in the "8. Test your Code" section of "Workflow Action - Custom Code". The text alongside this image reads: This improvement allows for a more streamlined coding experience, making it easier to write, debug, and manage custom asynchronous code. This new capability simplifies handling asynchronous operations and improves the overall efficiency of custom scripts. Immediately after, the guide continues: Custom Code AI Overview: Writing custom code in workflows just got smarter, faster, and easier—thanks to AI! We’re thrilled to introduce Code with AI (Beta), enabling users to generate custom code snippets with just a simple description…. Image 15 of 21 What this coversThis improvement allows for a more streamlined coding experience, making it easier to write, debug, and manage custom asynchronous code. This new capability simplifies handling asynchronous operations and improves the overall efficiency of custom scripts.
Buttons and menus referenced 9. Check Input Values in Execution logsCustom Code AI
Next stepCustom Code AI Overview: Writing custom code in workflows just got smarter, faster, and easier—thanks to AI! We’re thrilled to introduce Code with AI (Beta), enabling users to generate custom code snippets with just a simple description. Previous Behaviour: What’s New? Pro Tip: Be as specific as possible in your prompt for the best results! How to Use It? Use Cases
All 8 steps in this procedure
  1. Testing the code is a mandatory step, if the test is not done then user will not be able to use the output of the code in the subsequent steps.
  2. To test the code click on the "Test your Code" button.
  3. When you click on the button a new pop up will open where you can run the test.
  4. There can be 2 scenarios, first where you have added properties and second where you have not.
  5. In case there are properties are added you can enter the sample values in the "Test Setup" tab and test the Response.
  6. In case there are no properties added, you can directly check the response.
  7. Click on the "Test your Code" button to check the response.
  8. Post clicking on the test button, if there are no errors in the code them it will show " Test Result Success " and if there is an error in code then the result will be " Test Res ult Failed" and you would have to recheck the code to remove the error.

Custom Code AI

Overview:

Writing custom code in workflows just got smarter, faster, and easier—thanks to AI! We’re thrilled to introduce Code with AI (Beta), enabling users to generate custom code snippets with just a simple description.

Previous Behaviour:

  • Previously, creating custom code within workflows required users to write JavaScript code from scratch, which could be time-consuming and required programming expertise.
  • Manually map input properties from previous workflow steps to use within the code.
  • Test and debug code manually before implementation.
  • This process demanded a significant investment of time and technical skill.

What’s New?

  • Now we have AI-Assisted Code Generation. With Code with AI, the process is streamlined:
  • AI-Powered Code Generation – Describe the desired functionality in plain language, and AI will generate JavaScript code for you.
  • Automated Property Integration – AI intelligently incorporates relevant input properties based on your description.
  • One-Click Implementation – Quickly review and insert AI-generated code into your workflow.
  • Regenerate if Needed – Not happy with the first result? Click Generate again for a fresh version.
Pro Tip: 
Be as specific as possible in your prompt for the best results!

How to Use It?

  • Select: Choose Custom Code action in your workflow.
How to Use It? (image 16 of 21) What this shows This improvement allows for a more streamlined coding experience, making it easier to write, debug, and manage custom asynchronous code. What this shows Illustrates the "How to Use It?" section of "Workflow Action - Custom Code". This screenshot appears in the "How to Use It?" section of "Workflow Action - Custom Code". The text alongside this image reads: This improvement allows for a more streamlined coding experience, making it easier to write, debug, and manage custom asynchronous code. This new capability simplifies handling asynchronous operations and improves the overall efficiency of custom scripts. Immediately after, the guide continues: Custom value will not be passed when you are testing your code.Only the contact information will be passed when testing a code. Other properties used in the code will not pass while testing. Testing the code is mandatory. No output will…. Image 16 of 21 What this coversThis improvement allows for a more streamlined coding experience, making it easier to write, debug, and manage custom asynchronous code. This new capability simplifies handling asynchronous operations and improves the overall efficiency of custom scripts.
Buttons and menus referenced 9. Check Input Values in Execution logsCustom Code AI
Next stepCustom value will not be passed when you are testing your code.Only the contact information will be passed when testing a code. Other properties used in the code will not pass while testing. Testing the code is mandatory. No output will be available for untested code in subsequent action. Use the Property fields to assign key names and map values from previous steps. Use inputData.keyName or inputData['keyName'] to access the values within the code.
All 8 steps in this procedure
  1. Testing the code is a mandatory step, if the test is not done then user will not be able to use the output of the code in the subsequent steps.
  2. To test the code click on the "Test your Code" button.
  3. When you click on the button a new pop up will open where you can run the test.
  4. There can be 2 scenarios, first where you have added properties and second where you have not.
  5. In case there are properties are added you can enter the sample values in the "Test Setup" tab and test the Response.
  6. In case there are no properties added, you can directly check the response.
  7. Click on the "Test your Code" button to check the response.
  8. Post clicking on the test button, if there are no errors in the code them it will show " Test Result Success " and if there is an error in code then the result will be " Test Res ult Failed" and you would have to recheck the code to remove the error.
  • Activate AI: Click "Build with AI" to open the AI assistant.
How to Use It? (image 17 of 21) What this shows This improvement allows for a more streamlined coding experience, making it easier to write, debug, and manage custom asynchronous code. What this shows Illustrates the "How to Use It?" section of "Workflow Action - Custom Code". This screenshot appears in the "How to Use It?" section of "Workflow Action - Custom Code". The text alongside this image reads: This improvement allows for a more streamlined coding experience, making it easier to write, debug, and manage custom asynchronous code. This new capability simplifies handling asynchronous operations and improves the overall efficiency of custom scripts. Immediately after, the guide continues: Custom value will not be passed when you are testing your code.Only the contact information will be passed when testing a code. Other properties used in the code will not pass while testing. Testing the code is mandatory. No output will…. Image 17 of 21 What this coversThis improvement allows for a more streamlined coding experience, making it easier to write, debug, and manage custom asynchronous code. This new capability simplifies handling asynchronous operations and improves the overall efficiency of custom scripts.
Buttons and menus referenced 9. Check Input Values in Execution logsCustom Code AI
Next stepCustom value will not be passed when you are testing your code.Only the contact information will be passed when testing a code. Other properties used in the code will not pass while testing. Testing the code is mandatory. No output will be available for untested code in subsequent action. Use the Property fields to assign key names and map values from previous steps. Use inputData.keyName or inputData['keyName'] to access the values within the code.
All 8 steps in this procedure
  1. Testing the code is a mandatory step, if the test is not done then user will not be able to use the output of the code in the subsequent steps.
  2. To test the code click on the "Test your Code" button.
  3. When you click on the button a new pop up will open where you can run the test.
  4. There can be 2 scenarios, first where you have added properties and second where you have not.
  5. In case there are properties are added you can enter the sample values in the "Test Setup" tab and test the Response.
  6. In case there are no properties added, you can directly check the response.
  7. Click on the "Test your Code" button to check the response.
  8. Post clicking on the test button, if there are no errors in the code them it will show " Test Result Success " and if there is an error in code then the result will be " Test Res ult Failed" and you would have to recheck the code to remove the error.
  • Describe: Input your desired functionality (e.g., "I have an API that returns a date in MM-DD-YYYY format. Can you help me convert it to YYYY-MM-DD.").
  • Generate: Click Generate and let AI craft the code for you.
How to Use It? (image 18 of 21) What this shows This improvement allows for a more streamlined coding experience, making it easier to write, debug, and manage custom asynchronous code. What this shows Illustrates the "How to Use It?" section of "Workflow Action - Custom Code". This screenshot appears in the "How to Use It?" section of "Workflow Action - Custom Code". The text alongside this image reads: This improvement allows for a more streamlined coding experience, making it easier to write, debug, and manage custom asynchronous code. This new capability simplifies handling asynchronous operations and improves the overall efficiency of custom scripts. Immediately after, the guide continues: Custom value will not be passed when you are testing your code.Only the contact information will be passed when testing a code. Other properties used in the code will not pass while testing. Testing the code is mandatory. No output will…. Image 18 of 21 What this coversThis improvement allows for a more streamlined coding experience, making it easier to write, debug, and manage custom asynchronous code. This new capability simplifies handling asynchronous operations and improves the overall efficiency of custom scripts.
Buttons and menus referenced 9. Check Input Values in Execution logsCustom Code AI
Next stepCustom value will not be passed when you are testing your code.Only the contact information will be passed when testing a code. Other properties used in the code will not pass while testing. Testing the code is mandatory. No output will be available for untested code in subsequent action. Use the Property fields to assign key names and map values from previous steps. Use inputData.keyName or inputData['keyName'] to access the values within the code.
All 8 steps in this procedure
  1. Testing the code is a mandatory step, if the test is not done then user will not be able to use the output of the code in the subsequent steps.
  2. To test the code click on the "Test your Code" button.
  3. When you click on the button a new pop up will open where you can run the test.
  4. There can be 2 scenarios, first where you have added properties and second where you have not.
  5. In case there are properties are added you can enter the sample values in the "Test Setup" tab and test the Response.
  6. In case there are no properties added, you can directly check the response.
  7. Click on the "Test your Code" button to check the response.
  8. Post clicking on the test button, if there are no errors in the code them it will show " Test Result Success " and if there is an error in code then the result will be " Test Res ult Failed" and you would have to recheck the code to remove the error.
How to Use It? (image 19 of 21) What this shows This improvement allows for a more streamlined coding experience, making it easier to write, debug, and manage custom asynchronous code. What this shows Illustrates the "How to Use It?" section of "Workflow Action - Custom Code". This screenshot appears in the "How to Use It?" section of "Workflow Action - Custom Code". The text alongside this image reads: This improvement allows for a more streamlined coding experience, making it easier to write, debug, and manage custom asynchronous code. This new capability simplifies handling asynchronous operations and improves the overall efficiency of custom scripts. Immediately after, the guide continues: Custom value will not be passed when you are testing your code.Only the contact information will be passed when testing a code. Other properties used in the code will not pass while testing. Testing the code is mandatory. No output will…. Image 19 of 21 What this coversThis improvement allows for a more streamlined coding experience, making it easier to write, debug, and manage custom asynchronous code. This new capability simplifies handling asynchronous operations and improves the overall efficiency of custom scripts.
Buttons and menus referenced 9. Check Input Values in Execution logsCustom Code AI
Next stepCustom value will not be passed when you are testing your code.Only the contact information will be passed when testing a code. Other properties used in the code will not pass while testing. Testing the code is mandatory. No output will be available for untested code in subsequent action. Use the Property fields to assign key names and map values from previous steps. Use inputData.keyName or inputData['keyName'] to access the values within the code.
All 8 steps in this procedure
  1. Testing the code is a mandatory step, if the test is not done then user will not be able to use the output of the code in the subsequent steps.
  2. To test the code click on the "Test your Code" button.
  3. When you click on the button a new pop up will open where you can run the test.
  4. There can be 2 scenarios, first where you have added properties and second where you have not.
  5. In case there are properties are added you can enter the sample values in the "Test Setup" tab and test the Response.
  6. In case there are no properties added, you can directly check the response.
  7. Click on the "Test your Code" button to check the response.
  8. Post clicking on the test button, if there are no errors in the code them it will show " Test Result Success " and if there is an error in code then the result will be " Test Res ult Failed" and you would have to recheck the code to remove the error.
  • Regenerate - Want to make any changes in the Code, mention the changes in the text box and click on "Regenerate"
How to Use It? (image 20 of 21) What this shows This improvement allows for a more streamlined coding experience, making it easier to write, debug, and manage custom asynchronous code. What this shows Illustrates the "How to Use It?" section of "Workflow Action - Custom Code". This screenshot appears in the "How to Use It?" section of "Workflow Action - Custom Code". The text alongside this image reads: This improvement allows for a more streamlined coding experience, making it easier to write, debug, and manage custom asynchronous code. This new capability simplifies handling asynchronous operations and improves the overall efficiency of custom scripts. Immediately after, the guide continues: Custom value will not be passed when you are testing your code.Only the contact information will be passed when testing a code. Other properties used in the code will not pass while testing. Testing the code is mandatory. No output will…. Image 20 of 21 What this coversThis improvement allows for a more streamlined coding experience, making it easier to write, debug, and manage custom asynchronous code. This new capability simplifies handling asynchronous operations and improves the overall efficiency of custom scripts.
Buttons and menus referenced 9. Check Input Values in Execution logsCustom Code AI
Next stepCustom value will not be passed when you are testing your code.Only the contact information will be passed when testing a code. Other properties used in the code will not pass while testing. Testing the code is mandatory. No output will be available for untested code in subsequent action. Use the Property fields to assign key names and map values from previous steps. Use inputData.keyName or inputData['keyName'] to access the values within the code.
All 8 steps in this procedure
  1. Testing the code is a mandatory step, if the test is not done then user will not be able to use the output of the code in the subsequent steps.
  2. To test the code click on the "Test your Code" button.
  3. When you click on the button a new pop up will open where you can run the test.
  4. There can be 2 scenarios, first where you have added properties and second where you have not.
  5. In case there are properties are added you can enter the sample values in the "Test Setup" tab and test the Response.
  6. In case there are no properties added, you can directly check the response.
  7. Click on the "Test your Code" button to check the response.
  8. Post clicking on the test button, if there are no errors in the code them it will show " Test Result Success " and if there is an error in code then the result will be " Test Res ult Failed" and you would have to recheck the code to remove the error.
  • Implement: Review the output and click Use Code to insert it into your workflow.
How to Use It? (image 21 of 21) What this shows This improvement allows for a more streamlined coding experience, making it easier to write, debug, and manage custom asynchronous code. What this shows Illustrates the "How to Use It?" section of "Workflow Action - Custom Code". This screenshot appears in the "How to Use It?" section of "Workflow Action - Custom Code". The text alongside this image reads: This improvement allows for a more streamlined coding experience, making it easier to write, debug, and manage custom asynchronous code. This new capability simplifies handling asynchronous operations and improves the overall efficiency of custom scripts. Immediately after, the guide continues: Custom value will not be passed when you are testing your code.Only the contact information will be passed when testing a code. Other properties used in the code will not pass while testing. Testing the code is mandatory. No output will…. Image 21 of 21 What this coversThis improvement allows for a more streamlined coding experience, making it easier to write, debug, and manage custom asynchronous code. This new capability simplifies handling asynchronous operations and improves the overall efficiency of custom scripts.
Buttons and menus referenced 9. Check Input Values in Execution logsCustom Code AI
Next stepCustom value will not be passed when you are testing your code.Only the contact information will be passed when testing a code. Other properties used in the code will not pass while testing. Testing the code is mandatory. No output will be available for untested code in subsequent action. Use the Property fields to assign key names and map values from previous steps. Use inputData.keyName or inputData['keyName'] to access the values within the code.
All 8 steps in this procedure
  1. Testing the code is a mandatory step, if the test is not done then user will not be able to use the output of the code in the subsequent steps.
  2. To test the code click on the "Test your Code" button.
  3. When you click on the button a new pop up will open where you can run the test.
  4. There can be 2 scenarios, first where you have added properties and second where you have not.
  5. In case there are properties are added you can enter the sample values in the "Test Setup" tab and test the Response.
  6. In case there are no properties added, you can directly check the response.
  7. Click on the "Test your Code" button to check the response.
  8. Post clicking on the test button, if there are no errors in the code them it will show " Test Result Success " and if there is an error in code then the result will be " Test Res ult Failed" and you would have to recheck the code to remove the error.

Use Cases

  • Data Formatting – Automatically format phone numbers or dates to match your preferred style.
  • API Integration – Generate code to connect with external services via HTTP requests.
  • Mathematical Calculations – Compute interest rates, discount percentages, or other formulas dynamically.
  • String Manipulation – Extract key details from text, such as email addresses from subject lines.
  • Conditional Logic – Implement custom decision-making processes, like routing leads based on specific criteria.

Points to Remember

  • Custom value will not be passed when you are testing your code.Only the contact information will be passed when testing a code. Other properties used in the code will not pass while testing.
  • Testing the code is mandatory. No output will be available for untested code in subsequent action.
  • Use the Property fields to assign key names and map values from previous steps. Use inputData.keyName or inputData['keyName'] to access the values within the code.

Was this guide helpful?

Related guides