Learn how function and Workflow batch runs fit together.
⌘I
{"docsConfig":{"theme":"maple","$schema":"https://mintlify.com/docs.json","name":"Clay docs","description":"Developer documentation for using Clay from agents, CLIs, APIs, and internal systems.","colors":{"primary":"#008BAD","light":"#3BD3FD","dark":"#002833"},"logo":{"light":"https://mintcdn.com/claydevelopers/E7AZYsThqDl9nWJR/logo/clay-logo-black.png?fit=max\u0026auto=format\u0026n=E7AZYsThqDl9nWJR\u0026q=85\u0026s=9eb3a472bea12f615c6d3d0e3aa7ae80","dark":"https://mintcdn.com/claydevelopers/E7AZYsThqDl9nWJR/logo/clay-logo-dark.png?fit=max\u0026auto=format\u0026n=E7AZYsThqDl9nWJR\u0026q=85\u0026s=8965222d6054d8de130c32bdf590a415","href":"/"},"favicon":"https://mintcdn.com/claydevelopers/E7AZYsThqDl9nWJR/favicon/favicon.png?fit=max\u0026auto=format\u0026n=E7AZYsThqDl9nWJR\u0026q=85\u0026s=a72f28ec5f23b47d62eca67d5b6e05a0","api":{"openapi":"openapi.json","playground":{"display":"interactive","proxy":true},"examples":{"defaults":"required","languages":["curl","javascript","python"],"prefill":true,"autogenerate":true},"url":"full"},"appearance":{"default":"dark"},"background":{"color":{"light":"#FEFDFB","dark":"#1B1A18"}},"fonts":{"family":"Inter"},"icons":{"library":"lucide"},"styling":{"eyebrows":"breadcrumbs","codeblocks":{"theme":{"light":"github-light","dark":"github-dark"}},"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"claydevelopers","hasAudioNarration":false,"actualSubdomain":"claydevelopers","customDomains":["developers.clay.com"],"gitSource":{"type":"github","owner":"clay-run","repo":"clay-base","deployBranch":"deployed/production/api","contentDirectory":"apps/docs","isPrivate":true,"mountPath":"","label":""},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6afd11f71c0e198c9c436502","clientVersion":"0.0.4205","searchFilterCounts":[{"language":"default","tag":"API Reference","count":18},{"language":"default","tag":"Core primitives","count":12},{"language":"default","tag":"Recipes","count":11},{"language":"default","tag":"Concepts","count":7},{"language":"default","tag":"Routines","count":7},{"language":"default","tag":"Use cases","count":7},{"language":"default","tag":"search","count":6},{"language":"default","tag":"API basics","count":5},{"language":"default","tag":"routines","count":5},{"language":"default","tag":"Common flows","count":3}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"recipes/business-systems","slug":"/recipes/business-systems","pageMetadata":{"title":"Encode Clay functions into business systems","description":"Call Clay functions from backend jobs, internal tools, queues, and product workflows.","href":"/recipes/business-systems"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Call Clay functions from backend jobs, internal tools, queues, and product workflows.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,p:`p`,pre:`pre`,span:`span`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{Card,CodeBlock,Heading,Table}=_components;if(!Card)_missingMdxReference(`Card`,true);if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Use this pattern when Clay should run behind a backend job, queue, webhook, internal tool, or custom UI.`}),`\n`,_jsx(Heading,{level:`2`,id:`recommended-path`,children:`Recommended path`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Need`}),_jsx(_components.th,{children:`Use`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Common enrichment or research`}),_jsx(_components.td,{children:`Clay-managed function`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Existing team-specific Clay logic`}),_jsx(_components.td,{children:`Custom function`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Logic you want to build and edit from an agent or CLI`}),_jsx(_components.td,{children:`Workflows (Alpha)`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`call-from-the-api`,children:`Call from the API`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`18`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`18`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`ROUTINE_RUN_ID`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:`=`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`$(`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:`curl`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` --request`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` POST`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` --url`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"https://api.clay.com/public/v0/routines/function:t_abc123/run\"`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` --header`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` --header`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"clay-api-key: `}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`$CLAY_PUBLIC_API_KEY`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` --data`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"items\": [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"id\": \"row-1\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"inputs\": {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"domain\": \"clay.com\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` ]`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` }'`}),_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` |`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:` jq`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` -r`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` '.routine_run_id'`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:`curl`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` --request`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` GET`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` --url`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"https://api.clay.com/public/v0/routines/run/`}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`$ROUTINE_RUN_ID`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`/results\"`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` --header`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` \"clay-api-key: `}),_jsx(_components.span,{style:{color:`#24292E`,\"--shiki-dark\":`#E1E4E8`},children:`$CLAY_PUBLIC_API_KEY`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:`\"`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`call-from-the-plugin-or-cli`,children:`Call from the plugin or CLI`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light github-dark`,style:{backgroundColor:`#fff`,\"--shiki-dark-bg\":`#24292e`,color:`#24292e`,\"--shiki-dark\":`#e1e4e8`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:`echo`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` '{\"items\":[{\"id\":\"row-1\",\"inputs\":{\"domain\":\"clay.com\"}}]}'`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D73A49`,\"--shiki-dark\":`#F97583`},children:` |`}),_jsx(_components.span,{style:{color:`#6F42C1`,\"--shiki-dark\":`#B392F0`},children:` clay`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` routines`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` runs`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` start`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` function:t_abc123`}),_jsx(_components.span,{style:{color:`#005CC5`,\"--shiki-dark\":`#79B8FF`},children:` --input`}),_jsx(_components.span,{style:{color:`#032F62`,\"--shiki-dark\":`#9ECBFF`},children:` -`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`batch-the-same-function`,children:`Batch the same function`}),`\n`,_jsx(Card,{title:`Batch runs`,href:`/routines/batch-runs`,children:_jsx(_components.p,{children:`Learn how function and Workflow batch runs fit together.`})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"codeStyling":{"theme":{"light":"github-light","dark":"github-dark"}},"config":{},"pageMetadata":{"title":"Encode Clay functions into business systems","description":"Call Clay functions from backend jobs, internal tools, queues, and product workflows.","href":"/recipes/business-systems"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Recommended path","slug":"recommended-path","depth":2,"children":[]},{"title":"Call from the API","slug":"call-from-the-api","depth":2,"children":[]},{"title":"Call from the plugin or CLI","slug":"call-from-the-plugin-or-cli","depth":2,"children":[]},{"title":"Batch the same function","slug":"batch-the-same-function","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"claydevelopers","siteName":"Clay docs","title":"Encode Clay functions into business systems - Clay docs","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-13T15:57:25.304Z","originalFileLocation":"recipes/business-systems.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"dark\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Call Clay functions from backend jobs, internal tools, queues, and product workflows.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Clay docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/claydevelopers/USJssvcyClMZYpdJ/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/claydevelopers/USJssvcyClMZYpdJ/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/claydevelopers/USJssvcyClMZYpdJ/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/claydevelopers/USJssvcyClMZYpdJ/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/claydevelopers/USJssvcyClMZYpdJ/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/claydevelopers/USJssvcyClMZYpdJ/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/claydevelopers/USJssvcyClMZYpdJ/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/claydevelopers/USJssvcyClMZYpdJ/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/claydevelopers/USJssvcyClMZYpdJ/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Encode Clay functions into business systems - Clay docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"Call Clay functions from backend jobs, internal tools, queues, and product workflows.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Clay docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://developers.clay.com/recipes/business-systems\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://claydevelopers.mintlify.site/_mintlify/api/og/v2?division=Common+flows\u0026amp;title=Encode+Clay+functions+into+business+systems\u0026amp;description=Call+Clay+functions+from+backend+jobs%2C+internal+tools%2C+queues%2C+and+product+workflows.\u0026amp;theme=cc6a7271301efc2e822d1446\u0026amp;signature=1d7aa1ac5476909c2ab09eb685a0ca209f7777fbf1911e406441c42639ccaf73\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Encode Clay functions into business systems - Clay docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Call Clay functions from backend jobs, internal tools, queues, and product workflows.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://claydevelopers.mintlify.site/_mintlify/api/og/v2?division=Common+flows\u0026amp;title=Encode+Clay+functions+into+business+systems\u0026amp;description=Call+Clay+functions+from+backend+jobs%2C+internal+tools%2C+queues%2C+and+product+workflows.\u0026amp;theme=cc6a7271301efc2e822d1446\u0026amp;signature=1d7aa1ac5476909c2ab09eb685a0ca209f7777fbf1911e406441c42639ccaf73\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/claydevelopers/USJssvcyClMZYpdJ/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Clay docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#008BAD\">\u003clink data-mint-head rel=\"canonical\" href=\"https://developers.clay.com/recipes/business-systems\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/recipes/business-systems.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://developers.clay.com/#organization\",\"name\":\"Clay docs\",\"url\":\"https://developers.clay.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/claydevelopers/E7AZYsThqDl9nWJR/logo/clay-logo-black.png?fit=max\u0026auto=format\u0026n=E7AZYsThqDl9nWJR\u0026q=85\u0026s=9eb3a472bea12f615c6d3d0e3aa7ae80\"}},{\"@type\":\"WebSite\",\"@id\":\"https://developers.clay.com#website\",\"name\":\"Clay docs\",\"url\":\"https://developers.clay.com\",\"publisher\":{\"@id\":\"https://developers.clay.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://developers.clay.com/recipes/business-systems#webpage\",\"url\":\"https://developers.clay.com/recipes/business-systems\",\"name\":\"Encode Clay functions into business systems\",\"description\":\"Call Clay functions from backend jobs, internal tools, queues, and product workflows.\",\"dateModified\":\"2026-11-13T15:57:25.304Z\",\"isPartOf\":{\"@id\":\"https://developers.clay.com#website\"},\"breadcrumb\":{\"@id\":\"https://developers.clay.com/recipes/business-systems#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://developers.clay.com/recipes/business-systems#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Recipes\",\"item\":\"https://developers.clay.com/recipes/search-and-enrich\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Common flows\",\"item\":\"https://developers.clay.com/recipes/search-and-enrich\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Encode Clay functions into business systems\",\"item\":\"https://developers.clay.com/recipes/business-systems\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://developers.clay.com/recipes/business-systems#article\",\"headline\":\"Encode Clay functions into business systems\",\"name\":\"Encode Clay functions into business systems\",\"description\":\"Call Clay functions from backend jobs, internal tools, queues, and product workflows.\",\"url\":\"https://developers.clay.com/recipes/business-systems\",\"mainEntityOfPage\":{\"@id\":\"https://developers.clay.com/recipes/business-systems#webpage\"},\"dateModified\":\"2026-11-13T15:57:25.304Z\",\"publisher\":{\"@id\":\"https://developers.clay.com/#organization\"},\"isPartOf\":{\"@id\":\"https://developers.clay.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Clay docs\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Clay docs\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/recipes/business-systems.md","siteName":"Clay docs","nav":{"global":null,"groups":[{"group":"Start here","pages":[{"title":"Overview","href":"/index"},{"title":"Quickstart","href":"/quickstart"}]},{"group":"Core primitives","pages":[{"group":"Searches","pages":[{"title":"Searches","href":"/searches"},{"title":"Search with advanced queries","href":"/searches/advanced"}]},{"group":"Routines","pages":[{"title":"Routines overview","href":"/routines/index"},{"group":"Routine types","pages":[{"title":"Clay-managed functions","href":"/routines/clay-managed-functions"},{"title":"Custom functions","href":"/routines/custom-functions"},{"title":"Workflows (Alpha)","href":"/routines/workflows-alpha"}]},{"group":"Guides","pages":[{"title":"Routines API","href":"/routines/api"},{"title":"Functions vs. Workflows","href":"/routines/functions-vs-workflows"},{"title":"Batch runs","href":"/routines/batch-runs"}]}]},{"title":"Tables (Enterprise)","href":"/tables"},{"title":"Audiences","href":"/audiences"},{"title":"Signals","href":"/signals"}]},{"group":"Recipes","pages":[{"group":"Common flows","pages":[{"title":"Run a search, then enrich with a function","href":"/recipes/search-and-enrich"},{"title":"Give an agent access to a Clay function","description":"Let an agent call Clay-managed or custom functions from its normal workflow.","href":"/recipes/agent-function-access"},{"title":"Encode Clay functions into business systems","href":"/recipes/business-systems"}]},{"group":"Workflows (Alpha)","pages":[{"title":"Build a Workflow (Alpha)","description":"Use the Clay plugin and CLI to create, edit, run, and inspect a Workflow.","href":"/recipes/build-workflow-alpha"}]},{"group":"Use cases","pages":[{"title":"Use cases","href":"/use-cases/index"},{"title":"Enrich leads and accounts","href":"/use-cases/enrich-leads-and-accounts"},{"title":"Analyze recent closed-won deals","href":"/use-cases/analyze-recent-closed-won-deals"},{"title":"Search Clay's GTM database","href":"/use-cases/search-gtm-database"},{"title":"Use Clay tables as a database","href":"/use-cases/build-on-tables"},{"title":"Run GTM workflows","href":"/use-cases/run-gtm-workflows"},{"title":"Agent workflows","href":"/use-cases/agent-workflows"}]}]},{"group":"Concepts","pages":[{"title":"Execution model","href":"/concepts/execution-model"},{"title":"CLI basics","href":"/concepts/cli-basics"},{"group":"API basics","pages":[{"title":"Authentication","href":"/public-api/authentication"},{"title":"Pagination","href":"/public-api/pagination"},{"title":"Errors","href":"/public-api/errors"},{"title":"Rate limits","href":"/public-api/rate-limits"},{"title":"Webhooks","href":"/public-api/webhooks"}]}]},{"group":"API Reference","pages":[{"group":"audiences","pages":[{"title":"Privacy delete people from Audiences","deprecated":null,"version":null,"openapi":"/openapi.json post /audiences/privacy-delete","href":"/api-reference/audiences/privacy-delete-people-from-audiences"},{"title":"Get Audiences privacy deletion status","deprecated":null,"version":null,"openapi":"/openapi.json get /audiences/privacy-delete/{job_id}","href":"/api-reference/audiences/get-audiences-privacy-deletion-status"}]},{"group":"credits","pages":[{"title":"Get workspace credit balances","deprecated":null,"version":null,"openapi":"/openapi.json get /credits/balance","href":"/api-reference/credits/get-workspace-credit-balances"}]},{"group":"me","pages":[{"title":"Get the authenticated user","deprecated":null,"version":null,"openapi":"/openapi.json get /me","href":"/api-reference/me/get-the-authenticated-user"}]},{"group":"routines","pages":[{"title":"Fetch progress and results for a batch run","deprecated":null,"version":null,"openapi":"/openapi.json get /routines/run-batch/{routine_run_id}/results","href":"/api-reference/routines/fetch-progress-and-results-for-a-batch-run"},{"title":"Fetch progress and results for a routine run","deprecated":null,"version":null,"openapi":"/openapi.json get /routines/run/{routine_run_id}/results","href":"/api-reference/routines/fetch-progress-and-results-for-a-routine-run"},{"title":"Execute a routine against 1-100 items","deprecated":null,"version":null,"openapi":"/openapi.json post /routines/{routine_id}/run","href":"/api-reference/routines/execute-a-routine-against-1-100-items"},{"title":"Start an async routine run-batch over an uploaded JSONL file","deprecated":null,"version":null,"openapi":"/openapi.json post /routines/{routine_id}/run-batch/start","href":"/api-reference/routines/start-an-async-routine-run-batch-over-an-uploaded-jsonl-file"},{"title":"Issue a presigned PUT URL for uploading a batch input JSONL","deprecated":null,"version":null,"openapi":"/openapi.json post /routines/{routine_id}/run-batch/upload-url","href":"/api-reference/routines/issue-a-presigned-put-url-for-uploading-a-batch-input-jsonl"}]},{"group":"search","pages":[{"title":"Create a search from structured filters","deprecated":true,"version":null,"openapi":"/openapi.json post /search/filters-mode","href":"/api-reference/search/create-a-search-from-structured-filters"},{"title":"List the filter fields available for a search source type","deprecated":true,"version":null,"openapi":"/openapi.json get /search/filters-mode/fields","href":"/api-reference/search/list-the-filter-fields-available-for-a-search-source-type"},{"title":"Run the search iterator and return the next page of results","deprecated":true,"version":null,"openapi":"/openapi.json post /search/filters-mode/{search_id}/run","href":"/api-reference/search/run-the-search-iterator-and-return-the-next-page-of-results"},{"title":"Create a search from a Clay search query","deprecated":null,"version":null,"openapi":"/openapi.json post /search/query-mode","href":"/api-reference/search/create-a-search-from-a-clay-search-query"},{"title":"Get the Clay search query reference","deprecated":null,"version":null,"openapi":"/openapi.json get /search/query-mode/reference","href":"/api-reference/search/get-the-clay-search-query-reference"},{"title":"Run the query-mode iterator and return the next page of results","deprecated":null,"version":null,"openapi":"/openapi.json post /search/query-mode/{search_id}/run","href":"/api-reference/search/run-the-query-mode-iterator-and-return-the-next-page-of-results"}]},{"group":"tables","pages":[{"title":"Run a structured query across one or more tables","deprecated":null,"version":null,"openapi":"/openapi.json post /tables/query","href":"/api-reference/tables/run-a-structured-query-across-one-or-more-tables"}]},{"group":"workflowsRuns","pages":[{"title":"Search runs by query (beta)","deprecated":null,"version":null,"openapi":"/openapi.json post /workflows/runs/query","href":"/api-reference/workflowsruns/search-runs-by-query-beta"},{"title":"Get the runs search query reference (beta)","deprecated":null,"version":null,"openapi":"/openapi.json get /workflows/runs/query/reference","href":"/api-reference/workflowsruns/get-the-runs-search-query-reference-beta"}]}]}]},"basePath":"","title":"Encode Clay functions into business systems - Clay docs","deploymentId":"dpl_FZMKUpaaKiVETbfqhoUe4sPFDTmY","buildId":"dpl_FZMKUpaaKiVETbfqhoUe4sPFDTmY","dynamics":[],"chunks":[]}