Execute custom Javascript to handle data transformation, calculations, and complex logic.
The Code Block enables you to run custom Javascript within your Voice AI recipe. It provides a sandboxed environment to perform operations that standard blocks cannot handle, such as complex math, string manipulation, or array processing.Unlike the SmartAI block which relies on LLMs, the Code Block is deterministic and runs locally within the execution flow.
The Code Block executes in a lightweight, sandboxed environment with minimal resource usage. The execution time is negligible, meaning it does not add latency to the conversation flow. It is the preferred method for logic operations over using an LLM.
The Code Block does not use standard linear routing. Instead, it determines the path based on the outcome of the code execution.If Success
The workflow follows this connection if the code executes without throwing any errors. This is the primary path for valid logic execution.If Fails
The workflow follows this connection if:
There is a syntax error in the code.
A runtime error occurs during execution.
The execution times out.
Always connect the If Fails node to a fallback message or error handling block. This ensures the call does not hang or drop abruptly if your script encounters an unexpected issue.
You can validate your logic without publishing the recipe using the built-in test suite.
Define Inputs: Enter mock data in the Test variables pane on the right.
Execute: Click the Test button at the bottom right.
Debug: Review the Console pane to see console.log outputs or error traces.
Use the Code Block to sanitize data before passing it to a SmartAI block. For example, converting a raw timestamp (e.g., “1600”) into spoken time (e.g., “4 PM”) using code is faster and more reliable than asking the AI to figure it out.
Was this page helpful?
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Verloop.io Developer Docs","colors":{"primary":"#CA071A","light":"#FFFDF5","dark":"#151515"},"logo":{"light":"https://mintcdn.com/verloop-e1b50698/aPfc6m50tr8vi1yo/logo/verloop_logo_light.svg?fit=max\u0026auto=format\u0026n=aPfc6m50tr8vi1yo\u0026q=85\u0026s=a4830f0a4c6847e27e804fa5c7bc7c95","dark":"https://mintcdn.com/verloop-e1b50698/54BWXfeOd7KSBWgK/logo/verloop_logo_dark.svg?fit=max\u0026auto=format\u0026n=54BWXfeOd7KSBWgK\u0026q=85\u0026s=85ccf892cd6bf847ba178f6892202842"},"favicon":"https://mintcdn.com/verloop-e1b50698/aPfc6m50tr8vi1yo/favicon.png?fit=max\u0026auto=format\u0026n=aPfc6m50tr8vi1yo\u0026q=85\u0026s=7ddbeb96558ba241bdfa151f09d361b2","background":{"color":{"light":"#FFFDF5","dark":"#151515"}},"navbar":{"links":[{"href":"mailto:hello@verloop.io","label":"Support"}],"primary":{"type":"button","label":"Book a Demo","href":"https://www.verloop.io/get-demo/?ref=support-docs"}},"footer":{"socials":{"x":"https://x.com/verloopio","github":"https://github.com/verloop","linkedin":"https://linkedin.com/company/verloopio"}},"seo":{"metatags":{"og:type":"website","og:site_name":"Verloop.io Developer Docs","canonical":"https://docs.verloop.io","og:locale":"en_US","twitter:site":"@verloopio","google-site-verification":"pIe5c9jF3HkH4Hq7zy93siRRQU4p3VnGnARslRal0gI"},"indexing":"all"},"contextual":{"options":["copy","chatgpt","claude","cursor","vscode"],"display":"header"},"styling":{"latex":false},"navigation":{"global":{"anchors":[{"anchor":"Verloop.io","icon":"house","href":"https://verloop.io"},{"anchor":"Blog","icon":"newspaper","href":"https://www.verloop.io/blog/"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"verloop-e1b50698","hasAudioNarration":false,"actualSubdomain":"verloop-e1b50698","customDomains":["docs.verloop.io"],"gitSource":{"type":"github","owner":"sgaurav","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"feedback":{"issues":false,"thumbs":true},"entitlements":{},"buildId":"6ae924eaa03c4da4bef3b07f:success","clientVersion":"0.0.4111","searchFilterCounts":[{"language":"default","tag":"Documentation","count":37},{"language":"default","tag":"Build","count":21},{"language":"default","tag":"Create Voice Agent","count":10},{"language":"default","tag":"Recipe Blocks","count":6},{"language":"default","tag":"Integrate Telephony","count":5},{"language":"default","tag":"Test \u0026 Debug","count":4},{"language":"default","tag":"Best Practices","count":3},{"language":"default","tag":"Configure Voice \u0026 Accent","count":3},{"language":"default","tag":"Post Call Insights","count":3},{"language":"default","tag":"Overview","count":3}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"build/recipe-builder/recipe-block/code-block","slug":"/build/recipe-builder/recipe-block/code-block","pageMetadata":{"title":"Code Block","description":"Execute custom Javascript to handle data transformation, calculations, and complex logic.","href":"/build/recipe-builder/recipe-block/code-block"},"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: \"Execute custom Javascript to handle data transformation, calculations, and complex logic.\"\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`,hr:`hr`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Tip,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Tip)_missingMdxReference(`Tip`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`The `,_jsx(_components.strong,{children:`Code Block`}),` enables you to run custom Javascript within your Voice AI recipe. It provides a sandboxed environment to perform operations that standard blocks cannot handle, such as complex math, string manipulation, or array processing.`]}),`\n`,_jsx(_components.p,{children:`Unlike the SmartAI block which relies on LLMs, the Code Block is deterministic and runs locally within the execution flow.`}),`\n`,_jsx(Heading,{level:`2`,id:`key-features`,children:`Key Features`}),`\n`,_jsx(Heading,{level:`3`,id:`1-zero-latency-impact`,children:`1. Zero Latency Impact`}),`\n`,_jsxs(_components.p,{children:[`The Code Block executes in a lightweight, sandboxed environment with minimal resource usage. The execution time is negligible, meaning it `,_jsx(_components.strong,{children:`does not add latency`}),` to the conversation flow. It is the preferred method for logic operations over using an LLM.`]}),`\n`,_jsx(Heading,{level:`3`,id:`2-the-development-interface`,children:`2. The Development Interface`}),`\n`,_jsx(_components.p,{children:`The block opens into a dedicated code editor designed for safe development and testing.`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Editor Pane:`}),` Supports standard Javascript (ES6).`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Test Variables:`}),` A dedicated input section to define mock values for variables (e.g., `,_jsx(_components.code,{children:`{{account_balance}}`}),`) to simulate real call scenarios.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Console:`}),` A built-in debug console that captures logs and errors during testing.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`3-function-structure`,children:`3. Function Structure`}),`\n`,_jsx(_components.p,{children:`All logic must be wrapped within the main function, which exposes three core arguments:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` main`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`context`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`variables`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`plugins`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Your logic here`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // return variables; `})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`context`}),`: Contains metadata about the current call state.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`variables`}),`: Access to read and write recipe variables.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`plugins`}),`: Allows interaction with built-in system plugins to affect the broader workflow.`]}),`\n`]}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`workflow-routing`,children:`Workflow Routing`}),`\n`,_jsx(_components.p,{children:`The Code Block does not use standard linear routing. Instead, it determines the path based on the outcome of the code execution.`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`If Success`}),`\nThe workflow follows this connection if the code executes without throwing any errors. This is the primary path for valid logic execution.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`If Fails`}),`\nThe workflow follows this connection if:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`There is a syntax error in the code.`}),`\n`,_jsx(_components.li,{children:`A runtime error occurs during execution.`}),`\n`,_jsx(_components.li,{children:`The execution times out.`}),`\n`]}),`\n`,_jsx(Warning,{children:` Always connect the If Fails node to a fallback message or error handling block. This ensures the call does not hang or drop abruptly if your script encounters an unexpected issue. `}),`\n`,_jsx(Heading,{level:`2`,id:`testing-\u0026-debugging`,children:`Testing \u0026 Debugging`}),`\n`,_jsx(_components.p,{children:`You can validate your logic without publishing the recipe using the built-in test suite.`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Define Inputs`}),`: Enter mock data in the Test variables pane on the right.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Execute`}),`: Click the Test button at the bottom right.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Debug`}),`: Review the Console pane to see console.log outputs or error traces.`]}),`\n`]}),`\n`,_jsx(Tip,{children:` Use the Code Block to sanitize data before passing it to a SmartAI block. For example, converting a raw timestamp (e.g., “1600”) into spoken time (e.g., “4 PM”) using code is faster and more reliable than asking the AI to figure it out. `})]})}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":{"config":{},"pageMetadata":{"title":"Code Block","description":"Execute custom Javascript to handle data transformation, calculations, and complex logic.","href":"/build/recipe-builder/recipe-block/code-block"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Key Features","slug":"key-features","depth":2,"children":[{"title":"1. Zero Latency Impact","slug":"1-zero-latency-impact","depth":3,"children":[]},{"title":"2. The Development Interface","slug":"2-the-development-interface","depth":3,"children":[]},{"title":"3. Function Structure","slug":"3-function-structure","depth":3,"children":[]}]},{"title":"Workflow Routing","slug":"workflow-routing","depth":2,"children":[]},{"title":"Testing \u0026 Debugging","slug":"testing-\u0026-debugging","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"verloop-e1b50698","siteName":"Verloop.io Developer Docs","title":"Code Block - Verloop.io Developer Docs","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-01-31T14:41:23.208Z","originalFileLocation":"build/recipe-builder/recipe-block/code-block.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=\"system\"}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=\"Execute custom Javascript to handle data transformation, calculations, and complex logic.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Verloop.io Developer 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/verloop-e1b50698/kzZIXpcwxI9-0aEs/_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/verloop-e1b50698/kzZIXpcwxI9-0aEs/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/verloop-e1b50698/kzZIXpcwxI9-0aEs/_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/verloop-e1b50698/kzZIXpcwxI9-0aEs/_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/verloop-e1b50698/kzZIXpcwxI9-0aEs/_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/verloop-e1b50698/kzZIXpcwxI9-0aEs/_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/verloop-e1b50698/kzZIXpcwxI9-0aEs/_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/verloop-e1b50698/kzZIXpcwxI9-0aEs/_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/verloop-e1b50698/kzZIXpcwxI9-0aEs/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Code Block - Verloop.io Developer Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"Execute custom Javascript to handle data transformation, calculations, and complex logic.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Verloop.io Developer Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.verloop.io/build/recipe-builder/recipe-block/code-block\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://verloop-e1b50698.mintlify.site/_mintlify/api/og/v2?division=Recipe+Blocks\u0026amp;title=Code+Block\u0026amp;description=Execute+custom+Javascript+to+handle+data+transformation%2C+calculations%2C+and+complex+logic.\u0026amp;theme=b4a3d9934f6ae844542e41d2\u0026amp;signature=c2e05185cce71e588f8709c3e9831cbd8849feda9736e5b70ea9796963d03d6b\">\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=\"Code Block - Verloop.io Developer Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Execute custom Javascript to handle data transformation, calculations, and complex logic.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://verloop-e1b50698.mintlify.site/_mintlify/api/og/v2?division=Recipe+Blocks\u0026amp;title=Code+Block\u0026amp;description=Execute+custom+Javascript+to+handle+data+transformation%2C+calculations%2C+and+complex+logic.\u0026amp;theme=b4a3d9934f6ae844542e41d2\u0026amp;signature=c2e05185cce71e588f8709c3e9831cbd8849feda9736e5b70ea9796963d03d6b\">\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/verloop-e1b50698/kzZIXpcwxI9-0aEs/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Verloop.io Developer Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#CA071A\">\u003cmeta data-mint-head name=\"og:locale\" content=\"en_US\">\u003cmeta data-mint-head name=\"google-site-verification\" content=\"pIe5c9jF3HkH4Hq7zy93siRRQU4p3VnGnARslRal0gI\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.verloop.io/build/recipe-builder/recipe-block/code-block\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/build/recipe-builder/recipe-block/code-block.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.verloop.io/#organization\",\"name\":\"Verloop.io Developer Docs\",\"url\":\"https://docs.verloop.io\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/verloop-e1b50698/aPfc6m50tr8vi1yo/logo/verloop_logo_light.svg?fit=max\u0026auto=format\u0026n=aPfc6m50tr8vi1yo\u0026q=85\u0026s=a4830f0a4c6847e27e804fa5c7bc7c95\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.verloop.io#website\",\"name\":\"Verloop.io Developer Docs\",\"url\":\"https://docs.verloop.io\",\"publisher\":{\"@id\":\"https://docs.verloop.io/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.verloop.io/build/recipe-builder/recipe-block/code-block#webpage\",\"url\":\"https://docs.verloop.io/build/recipe-builder/recipe-block/code-block\",\"name\":\"Code Block\",\"description\":\"Execute custom Javascript to handle data transformation, calculations, and complex logic.\",\"dateModified\":\"2026-01-31T14:41:23.208Z\",\"isPartOf\":{\"@id\":\"https://docs.verloop.io#website\"},\"breadcrumb\":{\"@id\":\"https://docs.verloop.io/build/recipe-builder/recipe-block/code-block#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.verloop.io/build/recipe-builder/recipe-block/code-block#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Build\",\"item\":\"https://docs.verloop.io/build/recipe-builder/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create Voice Agent\",\"item\":\"https://docs.verloop.io/build/recipe-builder/overview\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Recipe Blocks\",\"item\":\"https://docs.verloop.io/build/recipe-builder/recipe-block/message-block\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Code Block\",\"item\":\"https://docs.verloop.io/build/recipe-builder/recipe-block/code-block\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.verloop.io/build/recipe-builder/recipe-block/code-block#article\",\"headline\":\"Code Block\",\"name\":\"Code Block\",\"description\":\"Execute custom Javascript to handle data transformation, calculations, and complex logic.\",\"url\":\"https://docs.verloop.io/build/recipe-builder/recipe-block/code-block\",\"mainEntityOfPage\":{\"@id\":\"https://docs.verloop.io/build/recipe-builder/recipe-block/code-block#webpage\"},\"dateModified\":\"2026-01-31T14:41:23.208Z\",\"publisher\":{\"@id\":\"https://docs.verloop.io/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.verloop.io#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Verloop.io Developer Docs\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Verloop.io Developer Docs\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/build/recipe-builder/recipe-block/code-block.md","siteName":"Verloop.io Developer Docs","nav":{"global":{"anchors":[{"anchor":"Verloop.io","icon":"house","href":"https://verloop.io"},{"anchor":"Blog","icon":"newspaper","href":"https://www.verloop.io/blog/"}]},"tabs":[{"tab":"Documentation","groups":[{"group":"Overview","pages":[{"title":"Introduction","href":""},{"title":"Capabilities","href":"/capabilities"},{"title":"Use Cases","href":"/usecases"}]},{"group":"Getting Started","pages":[{"title":"Quickstart","href":"/get-started/quick-start"},{"title":"Build Your First Recipe","href":"/get-started/first-recipe"},{"title":"Developer Tools Introduction","href":"/get-started/developer-start"}]},{"group":"Build","pages":[{"group":"Create Voice Agent","pages":[{"title":null,"href":"/build/recipe-builder/overview"},{"title":null,"href":"/build/recipe-builder/agent-settings"},{"title":"Smart Interruption","href":"/build/recipe-builder/smart-interruption"},{"title":null,"href":"/build/recipe-builder/recipe-blocks"},{"group":"Recipe Blocks","pages":[{"title":"Message Block","href":"/build/recipe-builder/recipe-block/message-block"},{"title":"SmartAI Block","href":"/build/recipe-builder/recipe-block/smartai-block"},{"title":"Ask Block","href":"/build/recipe-builder/recipe-block/ask-block"},{"title":"Condition Block","description":"Route conversations based on deterministic logic and variable comparisons.","href":"/build/recipe-builder/recipe-block/condition-block"},{"title":"Code Block","href":"/build/recipe-builder/recipe-block/code-block"},{"title":"API Block","description":"Extend your agent’s capabilities by integrating external systems to push and pull data in real-time.","href":"/build/recipe-builder/recipe-block/api-block"}]}]},{"group":"Configure Voice \u0026 Accent","pages":[{"title":null,"href":"/build/configure-voices/choose-agent-voice"},{"title":null,"href":"/build/configure-voices/add-custom-voice"},{"title":null,"href":"/build/configure-voices/add-pronunciation"}]},{"group":"Integrate Telephony","pages":[{"title":"Telephony Fundamentals","href":"/build/integrate-telephony/basics"},{"title":"Managing Phone Numbers","href":"/build/integrate-telephony/managing-phone-numbers"},{"title":"Speech Recognition Optimization","href":"/build/integrate-telephony/speech-recognition-optimization"},{"title":"Voice Setup \u0026 Personalization","href":"/build/integrate-telephony/voice-setup"},{"title":"Custom SIP Integration (BYOC)","href":"/build/integrate-telephony/sip-integration"}]},{"group":"Post Call Insights","pages":[{"title":"Post-Call Insights Overview","href":"/build/post-call-insights/overview"},{"title":"Defining Insight Parameters","href":"/build/post-call-insights/setup"},{"title":"Consuming Insight Data","href":"/build/post-call-insights/consuming-data"}]}]},{"group":"Test \u0026 Debug","pages":[{"title":"Testing \u0026 Debugging Overview","href":"/test-voice-agent/overview"},{"title":"Chat Testing \u0026 Debugging","href":"/test-voice-agent/manual-chat"},{"title":"Web Call Testing","href":"/test-voice-agent/web-call"},{"title":"Real Phone Call Testing","href":"/test-voice-agent/phone-call"}]},{"group":"Outreach","pages":[{"title":"Outreach Overview","href":"/outreach/overview"},{"title":"Create via Excel","href":"/outreach/bulk-upload"},{"title":"Create via API","href":"/outreach/campaign-api"}]},{"group":"Best Practices","pages":[{"title":"Mastering Dialects \u0026 Accents","href":"/best-practices/handling-dialects-and-accents"},{"title":"Accurate Voice Insights","href":"/best-practices/accurate-voice-agent-insights"},{"title":"Testing Best Practices","href":"/best-practices/detailed-guide-testing-voice-agents"}]}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/api-v1/introduction"}]}]},"basePath":"","title":"Code Block - Verloop.io Developer Docs","buildId":"dpl_DqYu5MPb49gWBBbUGgpHQUmCHY3P","deploymentId":"dpl_DqYu5MPb49gWBBbUGgpHQUmCHY3P","dynamics":[],"chunks":[]}