Skip to content

Functions Overview

Functions let you run custom server-side code that connects your HubSpot portal to external services and automates workflows. Each function is a tiny server — a lightweight, serverless script that runs on the edge.

Unlike UI extensions (which render components inside HubSpot), functions run behind the scenes. They can:

  • Receive incoming HTTP requests from webhooks or other services
  • Run on a recurring schedule (cron jobs)
  • Call any external API — HubSpot, Slack, Stripe, SendGrid, databases, and more
  • Read and write HubSpot CRM data using the HubSpot API

The functions page showing a grid of function cards with status badges

The functions page shows a card grid of all functions in your portal. Each card displays the function name, type badge, deployment status, and last deploy time. Click any card to open it in the function editor.

The new function creation form

Click the New Function card (the dashed outline) to open the creation form. You will be asked for:

  • Name — a descriptive name for your function (used as the script identifier)
  • Type — choose between Trigger (HTTP) or Scheduled (cron)
  • Cron expression — if you chose Scheduled, enter a cron pattern (e.g. 0 */6 * * * for every 6 hours)

After creation, you are taken directly to the function editor where you can start writing code with the help of the AI agent.

StatusMeaning
DraftThe function has been created but never deployed
DeployedThe function is live and running
FailedThe last deployment attempt failed
DisabledThe function has been manually disabled