Learn and master Clay with Clay university
Featured in Clay University
Reuse Logic with Functions
A Function is a reusable piece of logic you can use anywhere in your workspace. Next, you'll learn when to save your work as a Function and how to add one of Clay's own managed Functions to your workspace.
♻️ Why Functions Matter
If you have any programming background, you already know why functions matter.
Say you work in a niche industry that needs a specific kind of enrichment logic or persona identification, and you've built a workflow that walks through every step and every fallback. Save it as a Function and you can reuse it again and again without rebuilding it from scratch.
Functions also make AI better at building. When you build through the API or CLI, you can tell the AI to use the right Functions for the right tasks, which raises the odds of a better first draft.
The building pattern looks like this:
- Build from scratch, with a sharp eye on accuracy and on the logic of what you're building.
- Fine-tune, troubleshoot, and refine until it's right.
- Save it as a Function so every future build is faster and better.
🧰 Adding a Clay-Managed Function
You don't have to start from an empty library. Clay now offers Functions it has been using internally, which you can add to your workspace.
- Open Functions and click Browse Clay managed functions. You'll see options like Estimate Company IT Spend, Find Recent Company Developments, Get Company Hierarchy, Get Funding and Expansion Events, Validate Company Domain, and Generate ICP Fit.
- Pick one. Estimate Company IT Spend is a good example, because IT spend isn't an easy data point to get. It pulls estimates from a few data enrichment providers, then estimates the figure with AI using OpenAI at the end.
- Set it up as managed. Under Required API keys, add your own keys if you want to.
- Choose where it's available. Under Routines, Users exposes it through the Clay public API, the CLI, and MCP clients like ChatGPT. Exposing it everywhere is usually the right call. Claygent lets Claygents use it as a tool, which is worth turning on too.
- Choose who can use it. Roles go from Admin to Sales rep. Leave Sales rep off if you don't want reps using it, including through the MCP.
- Set Access permissions and finish.
You can also modify a managed Function, or duplicate it as a custom Function and make it your own.
Getting really good at using Functions effectively is one of the best investments you can make in Clay.
🚀 What's Next
You now know when to save your logic as a Function and how to add, configure, and customize a Clay-managed one.
Next, we'll look at the Clay MCP, which is how you share Functions and enrichments with the rest of your team.



