Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Contact Us
  • Home
  • Built-in tools
  • Webhooks & Code
  • Code

Generate a Code step using AI (Beta)

Written by Owner

Updated at August 20th, 2025

Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Tables
    Work with tables Manage tables Create tables Troubleshoot Zapier Tables
  • Product updates
    Product updates: January 2023 Product updates: March 2023 Product updates: February 2023 Product updates: April 2023 Product updates: May 2023 Product updates: June 2023 Product updates: July 2023 Product updates: August 2023 Product updates: September 2023 Product updates: October 2023 Product updates: November 2023 Product updates: December 2023 Product updates: January 2024 Product updates: February 2024 Product updates: March 2024 Product updates: April 2024 Product updates: May 2024 Product updates: June 2024 Product updates: July 2024 Product updates: August 2024 Product updates: September 2024 Product updates: October 2024 Product updates: November 2024 Product updates: December 2024 Product updates: January 2025 Product updates: February 2025 Product updates: March 2025 Product updates: April 2025 Product updates: May 2025 Product updates: June 2025 Product updates: July 2025 Product updates: August 2025
  • Zaps
    Zap basics Zap history Troubleshoot Zaps Manage your Zaps Do more with Zaps
  • Your Zapier account
    Plans Billing Account profile Notifications Data privacy & security Get help User roles and permissions
  • Interfaces
    Troubleshoot Zapier Interfaces Create an interface Use interface components Manage interfaces
  • Canvas
    Create a canvas Collaborate on a canvas
  • Chatbots
    Add logic and knowledge to chatbots Troubleshoot chatbots Create chatbots Manage chatbots
  • Getting started
    Intro to Zapier Set up your Zapier account Use case templates
  • Agents
    Create agents Manage agents Troubleshoot agents
  • MCP
    Set up MCP
  • Built-in tools
    Filter & Paths Formatter Schedule & Delay Email, IMAP, SMTP, & Email Parser Webhooks & Code Storage, Digest, & RSS Sub-Zap & Looping Other built-in tools Custom Actions & API Requests Functions AI by Zapier & AI actions Copilot Human in the Loop
  • Lead Router
    Create routers
  • Apps
    Connect and manage your app connections AI apps on Zapier Apps on Zapier
+ More

Table of Contents

Set up your AI-powered Code step How to write your prompt

You can use Code with AI to help you generate JavaScript or Python to use in your Zap. Describe what you'd like to do in your Code step, and AI will generate the code for you. 

miscBoltAlt icon Beta

AI-powered Code steps are a beta feature. It's available for use, but still in active development and may change. 

 

Set up your AI-powered Code step

  • In your trigger or action step, above the Code field, click Generate with AI.
  • In the dialog box, enter a prompt that describes your desired code.
  • Click Generate code.
  • Review the generated code.
  • Then you can:
    • Click the back arrow icon , then edit the prompt and click Generate code to try again.
    • Click the back arrow icon , keep the same prompt, then click Generate code to create new code using the same prompt.
    • Click Add code to accept the generated code and add it to your Code step.
    • Click Cancel to manually enter your code.
  • When the dialog box closes, click Continue.
  • In the Test tab, click Test step.
  • Review your test results.

 

How to write your prompt

  • Use plain language in your prompt. 
    • You do not need to use technical language. 
    • Avoid ambiguity–be clear and concise.
  • You can manually edit your AI-generated code at any time.
  • For action steps, you can reference:
    • Input data from your Code step.
    • Data from previous steps to add it as input data in your Code step for you. 
  • If you’re making a request to a specific API, it is recommended to include the name of the API in your prompt.
actionEdit icon Example

Here are some example prompts:

  • Get the current date and time and return it in the format: YYYY-MM-DD HH:MM:SS as an object.
  • Split the full name input into first and last.
  • Make an API request to the Star Wars API (swapi.dev) for details on the character name in the input and return the result.
  • Check if the value provided is prime.
  • Pad the amount given in inputData to the number of decimal places given in inputData.

Was this article helpful?

Yes
No
Give feedback about this article

Related Articles

  • Code by Zapier rate limits
  • JavaScript code examples in Zaps
  • Python code examples in Zaps
  • Store data from code steps with StoreClient
  • Use JavaScript code in Zaps

Copyright 2025 – OBZ-Zapier.

Knowledge Base Software powered by Helpjuice

Expand