Write Custom Code Faster with Build with AI

Inside the Custom Code action, Build with AI drafts JavaScript from a plain description. It writes code for one step. It does not build a whole workflow.

Prepare first

  • Add your Input Properties, the workflow values the code should read.
  • Know which output fields later steps need.
  • Remember that Custom Code is a premium action.

Generate and test

  1. Open Automation > Workflows and add or edit a Custom Code action.
  2. Add input properties, mapping each to a contact field or earlier output.
  3. Click Build with AI and describe the task, the inputs and the outputs you expect.
  4. Read the generated code line by line.
  5. Run the built-in test with realistic sample data.
  6. Confirm the output fields look right, then save the action.

Prompt examples

  • "Take the full name input and return first_name and last_name."
  • "Add 30 days to the date input and return it as YYYY-MM-DD."
  • "Build a JSON body from name, email and plan inputs."

Which AI tool to use

Use the AI Workflow Builder when you want help creating or editing the entire automation. Use Build with AI when only one step needs custom logic.

Good to know: Always test with edge cases such as empty fields before publishing, because code errors can stop a contact's progress.

Was this article helpful?