Home/HighLevel/Features/Workflows/HighLevel custom code action: setup, testing, and AI help

Workflows and Automation

HighLevel custom code action: setup, testing, and AI help

In short

Custom Code is a Premium Action in HighLevel workflows that lets you write JavaScript, reference data from earlier steps, make external HTTP calls, and return results for later actions. An AI assistant can also create code snippets from plain language descriptions, and a test tool validates the script before it runs in the workflow.

AreaWorkflows · Workflow Builder
Used forReal estate agency, Ecommerce store, Health clinic
PlanPremium
Setup steps15 steps in 3 tasks
Last updatedNovember 17, 2026

01Who this is for

  • Founders who need to connect the platform to services that have no native integration, because custom logic can be written in JavaScript.
  • Marketing teams that must reshape data, such as reformatting dates or phone numbers, before passing it to downstream actions.
  • Developers building multi step automations that require conditional logic or external API calls not covered by built in actions.

02Custom code, explained

Custom Code adds a new action option inside the workflow builder. When you select it, a code editor appears where you can write JavaScript. The editor includes a sample script, a formatter, and a button to run tests. Input values from previous steps are passed through a dictionary called InputData, which you map with the Property fields.

The action also supports making HTTP requests directly from the code. A button above the editor lets you choose a request method, GET, POST, PUT, PATCH, DELETE, HEAD, or OPTIONS, and inserts a request template. All console.log output is captured in execution logs for debugging. The AI assisted code generator (Beta) can produce a snippet based on a natural language description, automatically including relevant input properties.

To use the output, write a JavaScript object or an array of objects in the code. After a successful test, later workflow steps can reference the returned fields. Testing the code is mandatory; without a successful test, no output is available for subsequent actions.

03How businesses use custom code

  • Real estate agency. The agency adds a Custom Code action to format MLS listing dates returned from an external API. It maps the raw date property from the trigger, lets the AI generate JavaScript to reformat the date, tests the script, and then uses the formatted date in follow up email actions.
  • Ecommerce store. The store creates a Custom Code step that calculates a discount percentage based on order total. Input properties for total amount are mapped, the code performs the calculation, and the result is passed to a later step that tags the contact for a special campaign.
  • Health clinic. The clinic uses the HTTP request feature inside Custom Code to pull patient insurance verification data from a third party service. The code sends a POST request, receives a JSON response, and returns the verification status for use in appointment reminder workflows.

04How to set up and use custom code in HighLevel

Map input properties

  1. Click the Add Property button inside the Custom Code action.
  2. Enter a descriptive key name in the Key field.
  3. Choose a value from a previous step using the custom value picker.
  4. Repeat the process to add any additional properties needed.

Write and test code

  1. Open the Code Editor that appears with the Custom Code action.
  2. Replace the pre populated sample with your own JavaScript logic.
  3. Structure the script so that it returns a JavaScript object or array.
  4. Press the Test your Code button to open the testing popup.
  5. Provide sample values for any mapped properties in the Test Setup tab, run the test, and review the result.

Use AI to generate code

  1. Add a Custom Code action to your workflow.
  2. Click the Build with AI button to launch the AI assistant.
  3. Enter a plain language description of the functionality you need.
  4. Click Generate and let the AI produce a JavaScript snippet.
  5. If needed, edit the prompt and click Regenerate for a new version.
  6. Review the generated code and click Use Code to insert it into the workflow.

05What it looks like in HighLevel

06Settings that matter

  • Key input field. Defines the identifier used to reference a mapped value inside the InputData dictionary.
  • Add Property button. Creates a new entry in the InputData mapping so that values from earlier steps can be accessed in the code.
  • Code Editor. Provides a space to write JavaScript, view a sample script, and see formatting tools.
  • Format Code button. Automatically indents and spaces the script to improve readability.
  • Test your Code button. Opens a popup where you can run the script with sample inputs and see success or failure results.
  • HTTP Request button. Adds a template for an external HTTP call; you choose the method (GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS) and then customize the request in the editor.
  • Build with AI button. Starts the AI assisted code generation flow, allowing you to describe desired functionality and receive JavaScript code.

07Things to know before you rely on it

  • Custom Code is a Premium Action; it is only available on plans that include Premium features.
  • Testing the code is mandatory; untested code does not produce output for later workflow steps.
  • When testing, only contact information is passed; other custom values are not available during the test run.
  • The AI generated code feature is currently in Beta.

08If something goes wrong

  • Test Result Failed after running the script. Open the code editor, locate the error indicated in the console output, correct the JavaScript syntax or reference, and run the test again.

09How it connects to the rest of HighLevel

Michael's take

Michael Reimer
Michael ReimerFounder of CRM Pros, HighLevel Commander and Certified Admin

Ever wonder how to add a piece of logic that isn’t covered by the built in actions? Custom code lets you drop a JavaScript snippet right into a workflow, pull in values from earlier steps, hit external APIs and hand back structured data for the next action. It’s the go to when you need that extra layer of automation without building a separate integration.

If I were setting up a workflow that pulls a contact’s phone number, reformats it, and then sends it to a third party SMS service, I’d drop a Custom Code action, map the phone number into InputData, let the AI write the formatting code, test it, and then hand the formatted number to the SMS step. A quick test run makes sure the script works before the workflow goes live.

Get More InformationOpens on HighLevelPublished November 2, 2026 · Updated November 17, 2026

Common questions

Common questions about custom code.

What programming language does the Custom Code action use?

The editor defaults to JavaScript, and all code must be written in that language.

Is the Custom Code action available on all HighLevel plans?

Custom Code is a Premium Action, so it is only accessible on plans that include Premium features.

How do I pass data from earlier steps into my custom script?

Add properties in the Custom Code action, give each a key, and select a value from a prior step. Inside the script you reference them with inputData.keyName or inputData['keyName'].

Can I make an external API call from Custom Code?

Yes. Click the HTTP Request button, choose a method such as GET or POST, and the request template will appear in the code editor for you to customize.

What is required before the script output can be used in later actions?

The code must be tested successfully. If the test fails, no output is generated for subsequent workflow steps.

How does the AI code generation feature work?

Select Custom Code, click Build with AI, describe the needed functionality in plain language, and the AI returns a JavaScript snippet that you can review and insert with one click.

Next step

Pick the features that matter. Then get the plan that unlocks them.

Explore the features you want, start with the five at the top, and upgrade through my link when you are ready. The bonuses and the team come with it.

The features directory explains every HighLevel feature in plain English. Browse it to see what the platform can do.

Back to the FeaturesSee the full details
⌃

Site preview

Explore the next page

This destination is reserved in the page inventory and is not built yet.