# Workflow Action - Custom Code AI

> TABLE OF CONTENTS Overview: Previous Behaviour What’s New? How to Use It? Use Cases Overview: Writing custom code in workflows just got smarter, faster…

- Source: https://docs.ghlcustomercare.com/docs/workflows/workflow-builder/workflow-action-custom-code-ai
- Section: Workflows / Workflow Builder
- Reading time: 2 min
- Images: 6, each explained below

---
**TABLE OF CONTENTS**

-   [Overview:](#overview)[](#previous-behaviour)
    
-   [Previous Behaviour](#previous-behaviour)
    
-   [What’s New?](#whats-new)
    
-   [How to Use It?](#how-to-use-it)
    
-   [Use Cases](#use-cases)
    

#### 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 1 of 6)](https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/155042527561/original/nAuVDOdQnA_E5f_4vFRoyZnV4uiwuuVPLQ.png)

**How to Use It? (image 1 of 6)**

This screenshot appears in the "How to Use It?" section of "Workflow Action - Custom Code AI". For context, this section explains: TABLE OF CONTENTS 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…. This part of the guide covers 2 fields, listed below.
- Fields: Overview:, Previous Behaviour
- Controls: TABLE OF CONTENTS

-   Activate AI: Click "Build with AI" to open the AI assistant.

![How to Use It? (image 2 of 6)](https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/155042527587/original/NGS2QkhHBqVWTPkey7Js2HHEO9y-OxhfMw.png)

**How to Use It? (image 2 of 6)**

This screenshot appears in the "How to Use It?" section of "Workflow Action - Custom Code AI". For context, this section explains: TABLE OF CONTENTS 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…. This part of the guide covers 2 fields, listed below.
- Fields: Overview:, Previous Behaviour
- Controls: TABLE OF CONTENTS

-   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 3 of 6)](https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/155042527680/original/wHemORBiauxMu8J1jd5jKPyo-Ukw5r0AHg.png)

**How to Use It? (image 3 of 6)**

This screenshot appears in the "How to Use It?" section of "Workflow Action - Custom Code AI". For context, this section explains: TABLE OF CONTENTS 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…. This part of the guide covers 2 fields, listed below.
- Fields: Overview:, Previous Behaviour
- Controls: TABLE OF CONTENTS

![How to Use It? (image 4 of 6)](https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/155042527732/original/bbQ38-TfLfpWsC2KL8rjDbSwD0pjs1xVfA.png)

**How to Use It? (image 4 of 6)**

This screenshot appears in the "How to Use It?" section of "Workflow Action - Custom Code AI". For context, this section explains: TABLE OF CONTENTS 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…. This part of the guide covers 2 fields, listed below.
- Fields: Overview:, Previous Behaviour
- Controls: TABLE OF CONTENTS

-   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 5 of 6)](https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/155042527814/original/IdROuIKWKKyiOz_M_FaiBWIqEXTOuU2tsA.jpeg)

**How to Use It? (image 5 of 6)**

This screenshot appears in the "How to Use It?" section of "Workflow Action - Custom Code AI". For context, this section explains: TABLE OF CONTENTS 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…. This part of the guide covers 2 fields, listed below.
- Fields: Overview:, Previous Behaviour
- Controls: TABLE OF CONTENTS

-   Implement: Review the output and click Use Code to insert it into your workflow.

![How to Use It? (image 6 of 6)](https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/155042527822/original/raFUyfiaiJllR7EUEYNmwx7IBk8zZpL5tw.jpeg)

**How to Use It? (image 6 of 6)**

This screenshot appears in the "How to Use It?" section of "Workflow Action - Custom Code AI". For context, this section explains: TABLE OF CONTENTS 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…. This part of the guide covers 2 fields, listed below.
- Fields: Overview:, Previous Behaviour
- Controls: TABLE OF CONTENTS

#### 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.

---

Documentation for GHL Customer Care. Support: support@ghlcustomercare.com