Run sandboxed JavaScript inside Thoughtly automations for last-mile data transformation, custom API calls, and dynamic logic in agent and automation flows.
The Code integration lets advanced users run small JavaScript snippets inside automation flows or live agent actions. Use it for last-mile customization when built-in steps almost solve the workflow but you need to transform, validate, format, or calculate something first.Examples:
Normalize phone numbers before dialing.
Convert a webhook response into fields an agent can use.
Calculate a lead score.
Choose a local-presence number based on area code.
Route by date, time window, or custom business rules.
Code is not a general-purpose serverless environment. It runs in a restricted sandbox with time, memory, network, and security limits.
How it works
A Code step receives prior node outputs through an inputs object. Your script returns a JSON-serializable value. That return value becomes the step output and can be mapped into later steps or agent actions.
Test with realistic sample data before going live.
Avoid putting secrets in code.
Was this page helpful?
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Thoughtly Docs","colors":{"primary":"#32CB08","light":"#72FA4C","dark":"#424242"},"logo":{"light":"https://mintcdn.com/thoughtly/SDuN6oJ1BG6zNAlA/images/logo/light.svg?fit=max\u0026auto=format\u0026n=SDuN6oJ1BG6zNAlA\u0026q=85\u0026s=4d3354db16ce0ed2172d34e5e8035572","dark":"https://mintcdn.com/thoughtly/SDuN6oJ1BG6zNAlA/images/logo/dark.svg?fit=max\u0026auto=format\u0026n=SDuN6oJ1BG6zNAlA\u0026q=85\u0026s=58a7238c8201f8aeffddfdc60c80dd8c"},"favicon":"https://mintcdn.com/thoughtly/SDuN6oJ1BG6zNAlA/images/logo/icon.svg?fit=max\u0026auto=format\u0026n=SDuN6oJ1BG6zNAlA\u0026q=85\u0026s=d50cd38bf5f4eb0a9448d1f0a514e9ff","api":{"openapi":"api-reference/openapi.json","mdx":{"server":"https://api.thoughtly.com"}},"navbar":{"links":[{"href":"https://docs.thoughtly.com/support/changelog","label":"Changelog"}],"primary":{"type":"button","label":"Get Started","href":"https://thought.ly/demo"}},"footer":{"socials":{"x":"https://twitter.com/thoughtlyai","linkedin":"https://www.linkedin.com/company/thoughtly-ai","instagram":"https://www.instagram.com/thoughtly.ai","slack":"https://community.thoughtly.com"}},"seo":{"metatags":{"og:type":"website","og:site_name":"Thoughtly Docs"},"indexing":"all"},"integrations":{"ga4":{"measurementId":"G-4JRQ329JCS"},"intercom":{"appId":"uii3kkuk"}},"contextual":{"options":["copy","view","chatgpt","claude"],"display":"header"},"styling":{"latex":false},"navigation":{"global":{"anchors":[{"anchor":"Book a Demo","icon":"calendar","href":"https://thoughtly.com/demo"},{"anchor":"Platform Status","icon":"server","href":"https://status.thoughtly.com"},{"anchor":"Contact Support","icon":"life-ring","href":"mailto:support@thoughtly.com"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"thoughtly","hasAudioNarration":false,"actualSubdomain":"thoughtly","customDomains":["docs.thoughtly.com"],"gitSource":{"type":"github","owner":"thoughtlead-io","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"feedback":{"thumbs":true},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6ac7f6a1ac9242b21d007cf3","clientVersion":"0.0.4160","searchFilterCounts":[{"language":"default","tag":"Documentation","count":92},{"language":"default","tag":"Promptbooks","count":50},{"language":"default","tag":"Integrations","count":31},{"language":"default","tag":"Resources","count":28},{"language":"default","tag":"Native Integrations","count":23},{"language":"default","tag":"Glossary","count":21},{"language":"default","tag":"Agents","count":17},{"language":"default","tag":"Platform","count":17},{"language":"default","tag":"API Reference","count":13},{"language":"default","tag":"Settings","count":10}]},"assistantConfig":{"enableAskAiButton":true,"enableStarterQuestions":true,"enableAskAiSearchBar":true,"deflection":{"enabled":true,"email":"support@thoughtly.com","showHelpButton":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":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[{"_id":"690511b615e3c149686814cd","deploymentId":"6655d61f74c547ce373fda02","questionText":"How do I trigger an Automation using the API?","status":"active","generatedBy":"manual","createdAt":"2025-10-31T19:44:54.939Z","updatedAt":"2025-10-31T19:44:54.939Z","__v":0},{"_id":"690511ac15e3c14968681344","deploymentId":"6655d61f74c547ce373fda02","questionText":"What mid-call actions are available?","status":"active","generatedBy":"manual","createdAt":"2025-10-31T19:44:44.849Z","updatedAt":"2025-10-31T19:44:44.849Z","__v":0},{"_id":"690511a115e3c149686810f2","deploymentId":"6655d61f74c547ce373fda02","questionText":"How do I integrate Thoughtly with Salesforce?","status":"active","generatedBy":"manual","createdAt":"2025-10-31T19:44:33.341Z","updatedAt":"2025-10-31T19:44:33.341Z","__v":0}],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":"#promptbookGrid{display:grid;grid-template-columns:1fr;gap:1.5rem;padding-top:2rem;padding-bottom:2rem}:root{--docs-image-radius: clamp(8px, 1vw + 4px, 12px)}.mdx-content img:not([src$=\".svg\"i]):not(.no-radius),img[src^=\"/images/\"]:not([src$=\".svg\"i]):not(.no-radius){border-radius:var(--docs-image-radius)!important}.mdx-content img.radius-sm{border-radius:6px}.mdx-content img.radius-lg{border-radius:16px}@media (min-width: 640px){#promptbookGrid{grid-template-columns:repeat(2, 1fr)}}@media (min-width: 768px){#promptbookGrid{grid-template-columns:repeat(3, 1fr)}}@media (min-width: 1024px){#promptbookGrid{grid-template-columns:repeat(4, 1fr)}}.responsive-promptbook-heading{display:flex;flex-direction:column;gap:1rem;align-items:flex-start;justify-content:flex-start;margin-top:1rem;margin-bottom:1rem}@media (min-width: 768px){.responsive-promptbook-heading{flex-direction:row;align-items:center;justify-content:space-between}}.promptbook-card{box-shadow:0 0 10px rgba(0, 0, 0, 0.05)}.promptbook-card:hover{box-shadow:0 0 10px rgba(0, 0, 0, 0.2);scale:1.01;transition:all 0.3s ease}.promptbook-content{font-family:system-ui, sans-serif;color:#1f2937;line-height:1.7;max-width:100%;padding-bottom:2rem}.promptbook-content h1,.promptbook-content h2,.promptbook-content h3,.promptbook-content h4,.promptbook-content h5,.promptbook-content h6{font-weight:600;color:#111827;margin-top:2rem;margin-bottom:1rem;line-height:1.25}.promptbook-content h1{font-size:2rem}.promptbook-content h2{font-size:1.5rem}.promptbook-content h3{font-size:1.25rem}.promptbook-content h4{font-size:1.1rem}.promptbook-content h5{font-size:1rem}.promptbook-content h6{font-size:0.95rem}.promptbook-content p{margin-top:1rem;margin-bottom:1rem}.promptbook-content strong{font-weight:600}.promptbook-content em{font-style:italic}.promptbook-content a{color:#32CB08;text-decoration:underline;transition:color 0.2s ease-in-out}.promptbook-content a:hover{color:#26a005}.promptbook-content ul,.promptbook-content ol{margin-top:1rem;margin-bottom:1rem;padding-left:1.5rem}.promptbook-content ul li::marker{color:#32CB08}.promptbook-content blockquote{border-left:4px solid #32CB08;padding-left:1rem;color:#6b7280;font-style:italic;margin:1.5rem 0}.promptbook-content pre{background-color:#f9fafb;color:#111827;padding:1rem;border-radius:6px;overflow-x:auto;margin:1.5rem 0}.promptbook-content code{background-color:#f3f4f6;padding:0.2rem 0.4rem;border-radius:4px;font-size:0.9em;font-family:monospace}.promptbook-content hr{border:none;border-top:1px solid #e5e7eb;margin:2rem 0}"}],"page":{"pagePath":"integrations/developer/code","slug":"/integrations/developer/code","pageMetadata":{"title":"Code","description":"Run sandboxed JavaScript inside Thoughtly automations for last-mile data transformation, custom API calls, and dynamic logic in agent and automation flows.","href":"/integrations/developer/code"},"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: \"Run sandboxed JavaScript inside Thoughtly automations for last-mile data transformation, custom API calls, and dynamic logic in agent and automation flows.\"\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`,li:`li`,p:`p`,pre:`pre`,span:`span`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`The Code integration lets advanced users run small JavaScript snippets inside automation flows or live agent actions. Use it for last-mile customization when built-in steps almost solve the workflow but you need to transform, validate, format, or calculate something first.`}),`\n`,_jsx(_components.p,{children:`Examples:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Normalize phone numbers before dialing.`}),`\n`,_jsx(_components.li,{children:`Convert a webhook response into fields an agent can use.`}),`\n`,_jsx(_components.li,{children:`Calculate a lead score.`}),`\n`,_jsx(_components.li,{children:`Choose a local-presence number based on area code.`}),`\n`,_jsx(_components.li,{children:`Route by date, time window, or custom business rules.`}),`\n`]}),`\n`,_jsx(Warning,{children:_jsx(_components.p,{children:`Code is not a general-purpose serverless environment. It runs in a restricted sandbox with time, memory, network, and security limits.`})}),`\n`,_jsx(Heading,{level:`2`,id:`how-it-works`,children:`How it works`}),`\n`,_jsxs(_components.p,{children:[`A Code step receives prior node outputs through an `,_jsx(_components.code,{children:`inputs`}),` object. Your script returns a JSON-serializable value. That return value becomes the step output and can be mapped into later steps or agent actions.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`6`,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:`6`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` phone`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` inputs`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'trigger'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`].`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`phone`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` digits`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` phone`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`replace`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D16969`},children:`/`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D16969`},children:`\\\\D`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D16969`},children:`/`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`g`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`''`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` e164:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` digits`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`startsWith`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'1'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`?`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\" `+\"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`digits`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`\"}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` :`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\" `+1\"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`digits`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`configuration`,children:`Configuration`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Field`}),_jsx(_components.th,{children:`Required`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Code`}),_jsx(_components.td,{children:`Yes`}),_jsx(_components.td,{children:`JavaScript to execute. Must return a JSON-serializable value.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Timeout`}),_jsx(_components.td,{children:`No`}),_jsx(_components.td,{children:`Maximum execution time. Shorter limits apply during live calls to protect call quality.`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`use-variables-from-prior-steps`,children:`Use variables from prior steps`}),`\n`,_jsxs(_components.p,{children:[`Use the data picker to insert references to previous outputs. References are inserted as `,_jsx(_components.code,{children:`inputs['nodeId'].fieldName`}),` paths.`]}),`\n`,_jsx(_components.p,{children:`Example:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`6`,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:`6`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` firstName`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` inputs`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'create_contact'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`].`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`first_name`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` appointmentDate`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` inputs`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'check_availability'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`].`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`selected_time`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` message:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\" `Hi \"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`firstName`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`, your appointment is confirmed for `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`appointmentDate`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\".`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`limits`,children:`Limits`}),`\n`,_jsx(_components.p,{children:`Typical limits include:`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Limit`}),_jsx(_components.th,{children:`Why it exists`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Execution timeout`}),_jsx(_components.td,{children:`Prevents slow scripts from blocking workflows or live calls.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Memory cap`}),_jsx(_components.td,{children:`Protects platform stability.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Code size cap`}),_jsx(_components.td,{children:`Keeps snippets small and reviewable.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Console output cap`}),_jsx(_components.td,{children:`Prevents excessive logs.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Concurrency cap`}),_jsx(_components.td,{children:`Prevents one workspace from consuming all runner capacity.`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`blocked-capabilities`,children:`Blocked capabilities`}),`\n`,_jsx(_components.p,{children:`The sandbox blocks risky or platform-level operations, including:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Network calls such as `,_jsx(_components.code,{children:`fetch`}),`, `,_jsx(_components.code,{children:`XMLHttpRequest`}),`, or `,_jsx(_components.code,{children:`WebSocket`})]}),`\n`,_jsxs(_components.li,{children:[`Node.js built-ins such as `,_jsx(_components.code,{children:`require`}),` or `,_jsx(_components.code,{children:`process`})]}),`\n`,_jsxs(_components.li,{children:[`Code generation such as `,_jsx(_components.code,{children:`eval`}),`, `,_jsx(_components.code,{children:`new Function`}),`, or dynamic `,_jsx(_components.code,{children:`import()`})]}),`\n`,_jsx(_components.li,{children:`Known sandbox escape patterns`}),`\n`,_jsx(_components.li,{children:`Obvious infinite loops`}),`\n`]}),`\n`,_jsx(_components.p,{children:`If your workflow needs external API access, use a webhook or integration step before or after the Code step.`}),`\n`,_jsx(Heading,{level:`2`,id:`examples`,children:`Examples`}),`\n`,_jsx(Heading,{level:`3`,id:`validate-an-email-address`,children:`Validate an email address`}),`\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:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` email`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` inputs`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'trigger'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`].`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`email`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` valid`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D16969`},children:` /`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#DCDCAA`},children:`^`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#CE9178`},children:`[`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#CE9178`},children:`^`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D16969`},children:`\\\\s@`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#CE9178`},children:`]`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`+`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D16969`},children:`@`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#CE9178`},children:`[`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#CE9178`},children:`^`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D16969`},children:`\\\\s@`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#CE9178`},children:`]`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`+`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-light-font-weight\":`bold`,\"--shiki-dark\":`#D7BA7D`,\"--shiki-dark-font-weight\":`inherit`},children:`\\\\.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#CE9178`},children:`[`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#CE9178`},children:`^`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D16969`},children:`\\\\s@`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#CE9178`},children:`]`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`+`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#DCDCAA`},children:`$`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D16969`},children:`/`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`test`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`email`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`email`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`valid`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`calculate-a-lead-score`,children:`Calculate a lead score`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`11`,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:`11`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` lead`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` inputs`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'create_or_update_contact'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` score`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`lead`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`budget`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` >=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 50000`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ?`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 40`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` :`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 20`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`+`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`lead`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`timeline`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ===`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'immediate'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ?`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 30`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` :`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 10`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`+`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`lead`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`company_size`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` >=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 100`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ?`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 30`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` :`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 10`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` score`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` qualified:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` score`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` >=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 70`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`route-by-area-code`,children:`Route by area code`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`10`,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:`10`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` digits`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` inputs`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'trigger'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`].`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`phone`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`replace`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D16969`},children:`/`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D16969`},children:`\\\\D`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D16969`},children:`/`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`g`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`''`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` areaCode`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` digits`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#9CDCFE`},children:`length`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ===`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 11`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ?`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` digits`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`slice`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`4`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` digits`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`slice`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`3`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` region`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '212'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'new_york'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '646'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'new_york'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '415'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'san_francisco'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}[`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`areaCode`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`] `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`||`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'default'`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`areaCode`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`region`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`best-practices`,children:`Best practices`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Keep scripts short and focused.`}),`\n`,_jsx(_components.li,{children:`Return structured JSON objects, not long strings.`}),`\n`,_jsx(_components.li,{children:`Use webhooks or CRM steps for external API calls.`}),`\n`,_jsx(_components.li,{children:`Test with realistic sample data before going live.`}),`\n`,_jsx(_components.li,{children:`Avoid putting secrets in code.`}),`\n`]})]})}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","description":"Run sandboxed JavaScript inside Thoughtly automations for last-mile data transformation, custom API calls, and dynamic logic in agent and automation flows.","href":"/integrations/developer/code"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"How it works","slug":"how-it-works","depth":2,"children":[]},{"title":"Configuration","slug":"configuration","depth":2,"children":[]},{"title":"Use variables from prior steps","slug":"use-variables-from-prior-steps","depth":2,"children":[]},{"title":"Limits","slug":"limits","depth":2,"children":[]},{"title":"Blocked capabilities","slug":"blocked-capabilities","depth":2,"children":[]},{"title":"Examples","slug":"examples","depth":2,"children":[{"title":"Validate an email address","slug":"validate-an-email-address","depth":3,"children":[]},{"title":"Calculate a lead score","slug":"calculate-a-lead-score","depth":3,"children":[]},{"title":"Route by area code","slug":"route-by-area-code","depth":3,"children":[]}]},{"title":"Best practices","slug":"best-practices","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/thoughtly/79fc8fef0e90a20d/content/promptbook-scripts.js"],"subdomain":"thoughtly","siteName":"Thoughtly Docs","title":"Code - Thoughtly Docs","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-05-22T13:29:49.680Z","originalFileLocation":"integrations/developer/code.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=\"Run sandboxed JavaScript inside Thoughtly automations for last-mile data transformation, custom API calls, and dynamic logic in agent and automation flows.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Thoughtly 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/thoughtly/weHpxQJRTR6-Xzn6/_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/thoughtly/weHpxQJRTR6-Xzn6/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/thoughtly/weHpxQJRTR6-Xzn6/_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/thoughtly/weHpxQJRTR6-Xzn6/_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/thoughtly/weHpxQJRTR6-Xzn6/_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/thoughtly/weHpxQJRTR6-Xzn6/_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/thoughtly/weHpxQJRTR6-Xzn6/_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/thoughtly/weHpxQJRTR6-Xzn6/_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/thoughtly/weHpxQJRTR6-Xzn6/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Code - Thoughtly Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"Run sandboxed JavaScript inside Thoughtly automations for last-mile data transformation, custom API calls, and dynamic logic in agent and automation flows.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Thoughtly Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.thoughtly.com/integrations/developer/code\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://thoughtly.mintlify.site/_mintlify/api/og/v2?division=Integrations\u0026amp;title=Code\u0026amp;description=Run+sandboxed+JavaScript+inside+Thoughtly+automations+for+last-mile+data+transformation%2C+custom+API+calls%2C+and+dynamic+logic+in+agent+and+automation+flows.\u0026amp;theme=e6e8ef15773ebca659285773\u0026amp;signature=e5300229787411f697e571bc7b8226ea0b19a039142bc4b879a2472b7c244200\">\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 - Thoughtly Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Run sandboxed JavaScript inside Thoughtly automations for last-mile data transformation, custom API calls, and dynamic logic in agent and automation flows.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://thoughtly.mintlify.site/_mintlify/api/og/v2?division=Integrations\u0026amp;title=Code\u0026amp;description=Run+sandboxed+JavaScript+inside+Thoughtly+automations+for+last-mile+data+transformation%2C+custom+API+calls%2C+and+dynamic+logic+in+agent+and+automation+flows.\u0026amp;theme=e6e8ef15773ebca659285773\u0026amp;signature=e5300229787411f697e571bc7b8226ea0b19a039142bc4b879a2472b7c244200\">\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/thoughtly/weHpxQJRTR6-Xzn6/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Thoughtly Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#32CB08\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.thoughtly.com/integrations/developer/code\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/integrations/developer/code.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.thoughtly.com/#organization\",\"name\":\"Thoughtly Docs\",\"url\":\"https://docs.thoughtly.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/thoughtly/SDuN6oJ1BG6zNAlA/images/logo/light.svg?fit=max\u0026auto=format\u0026n=SDuN6oJ1BG6zNAlA\u0026q=85\u0026s=4d3354db16ce0ed2172d34e5e8035572\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.thoughtly.com#website\",\"name\":\"Thoughtly Docs\",\"url\":\"https://docs.thoughtly.com\",\"publisher\":{\"@id\":\"https://docs.thoughtly.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.thoughtly.com/integrations/developer/code#webpage\",\"url\":\"https://docs.thoughtly.com/integrations/developer/code\",\"name\":\"Code\",\"description\":\"Run sandboxed JavaScript inside Thoughtly automations for last-mile data transformation, custom API calls, and dynamic logic in agent and automation flows.\",\"dateModified\":\"2026-05-22T13:29:49.680Z\",\"isPartOf\":{\"@id\":\"https://docs.thoughtly.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.thoughtly.com/integrations/developer/code#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.thoughtly.com/integrations/developer/code#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Tools\",\"item\":\"https://docs.thoughtly.com/genius/getting-started\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Integrations\",\"item\":\"https://docs.thoughtly.com/integrations/getting-started\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Code\",\"item\":\"https://docs.thoughtly.com/integrations/developer/code\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.thoughtly.com/integrations/developer/code#article\",\"headline\":\"Code\",\"name\":\"Code\",\"description\":\"Run sandboxed JavaScript inside Thoughtly automations for last-mile data transformation, custom API calls, and dynamic logic in agent and automation flows.\",\"url\":\"https://docs.thoughtly.com/integrations/developer/code\",\"mainEntityOfPage\":{\"@id\":\"https://docs.thoughtly.com/integrations/developer/code#webpage\"},\"dateModified\":\"2026-05-22T13:29:49.680Z\",\"publisher\":{\"@id\":\"https://docs.thoughtly.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.thoughtly.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Thoughtly Docs\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Thoughtly Docs\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/integrations/developer/code.md","siteName":"Thoughtly Docs","nav":{"global":{"anchors":[{"anchor":"Book a Demo","icon":"calendar","href":"https://thoughtly.com/demo"},{"anchor":"Platform Status","icon":"server","href":"https://status.thoughtly.com"},{"anchor":"Contact Support","icon":"life-ring","href":"mailto:support@thoughtly.com"}]},"tabs":[{"tab":"Documentation","groups":[{"group":"Getting Started","icon":{"style":"light","name":"rocket"},"pages":[{"title":"Introduction to Thoughtly","href":"/getting-started/introduction"},{"title":"Quick start guide","href":"/getting-started/quick-start"},{"title":"Voice agent use cases and examples","href":"/getting-started/use-cases"},{"title":"Developer documentation","href":"/developers"}]},{"group":"Agents","icon":{"style":"light","name":"diagram-nested"},"pages":[{"title":"Agent Builder overview","href":"/agents/overview"},{"group":"Building","pages":[{"title":"Node types in the Agent Builder","href":"/agents/nodes"},{"title":"Outcomes and conversation branching","href":"/agents/outcomes"},{"title":"Variables in voice agents","href":"/agents/variables"},{"title":"Actions","href":"/agents/actions"},{"title":"Agent settings","href":"/agents/settings"},{"title":"Vibes AI assistant","href":"/agents/vibes-assistant"}]},{"group":"Voices","pages":[{"title":"Agent voices","href":"/agents/voices"},{"title":"Voice optimization for natural speech","href":"/agents/voice-optimization"},{"title":"Bring Your Own Key (BYOK) for voices","href":"/agents/voice-byok"},{"title":"Voice cloning for agents","href":"/agents/voice-cloning"}]},{"group":"Launch","pages":[{"title":"Test voice agents before launch","href":"/agents/testing"},{"title":"Voice agent tips and tricks","href":"/agents/tips-and-tricks"},{"title":"Deploy a voice agent","href":"/agents/deployment"}]},{"group":"Reference","pages":[{"title":"Troubleshoot Thoughtly voice agents","href":"/agents/troubleshooting"},{"title":"Call screening bypass","href":"/agents/call-screening-bypass"},{"title":"Migrate legacy agents to v1.8 Agent Builder","href":"/agents/migration-guide"}]}]},{"group":"Audiences","icon":{"style":"light","name":"users"},"pages":[{"title":"Audiences and contact management","href":"/platform/audiences"}]},{"group":"History","icon":{"style":"light","name":"clock-rotate-left"},"pages":[{"title":"Call and conversation history","href":"/platform/history"}]},{"group":"Tools","icon":{"style":"light","name":"toolbox"},"pages":[{"group":"Genius","pages":[{"title":"Get started with Genius knowledge bases","href":"/genius/getting-started"},{"title":"Data sources for Genius","href":"/genius/sources"},{"title":"Genius knowledge base best practices","href":"/genius/best-practices"},{"title":"Bind Genius knowledge to agents","href":"/genius/agent-binding"},{"title":"Troubleshoot Genius knowledge bases","href":"/genius/troubleshooting"}]},{"group":"Automations","pages":[{"title":"Get started with Thoughtly automations","href":"/automations/getting-started"},{"title":"Automation triggers","href":"/automations/triggers"},{"title":"Automation actions and steps","href":"/automations/actions"},{"title":"Attributes vs metadata in automations","href":"/automations/attributes-vs-metadata"},{"title":"Troubleshoot Thoughtly automations","href":"/automations/troubleshooting"}]},{"group":"Integrations","pages":[{"title":"Get started with Thoughtly integrations","href":"/integrations/getting-started"},{"title":"Webhooks configuration","href":"/integrations/webhooks"},{"title":"Troubleshoot Thoughtly integrations","href":"/integrations/troubleshooting"},{"title":"WhatsApp Business","href":"/integrations/communication/whatsapp-business"},{"title":"iMessage / Linq","href":"/integrations/communication/imessage-linq"},{"title":"CRM sync","description":"Sync contacts and attributes inbound from your CRM into Thoughtly audiences so agents and automations work from current CRM data. Write outcomes back to your CRM using automation actions.","href":"/integrations/crm/crm-sync"},{"title":"Code","href":"/integrations/developer/code"},{"title":"MCP Server","description":"Connect AI assistants like Claude and ChatGPT to your Thoughtly conversation data with the Thoughtly MCP server. Query calls, SMS, and email transcripts using natural language through the Model Context Protocol.","href":"/integrations/developer/mcp"}]}]},{"group":"Platform","icon":{"style":"light","name":"sliders"},"pages":[{"title":"Platform overview","href":"/platform/overview"},{"title":"Omnichannel agents","href":"/platform/omnichannel"},{"title":"Workspace switcher","href":"/platform/workspace-switcher"},{"title":"User menu","href":"/platform/user-menu"},{"group":"Workspaces","pages":[{"title":"Workspaces and team collaboration","href":"/platform/teams/overview"}]},{"title":"Billing on Thoughtly","href":"/platform/billing"},{"title":"Analytics in Thoughtly","href":"/platform/analytics"},{"group":"Settings","pages":[{"title":"General workspace settings","href":"/platform/settings/general"},{"title":"Audiences settings","href":"/platform/settings/audiences"},{"title":"Dark windows and quiet hours","href":"/platform/settings/dark-windows"},{"title":"Phone numbers settings","href":"/platform/settings/phone-numbers"},{"title":"Voices settings","href":"/platform/settings/voices"},{"title":"Usage and credit consumption","href":"/platform/settings/usage"},{"title":"Subscription and plan","href":"/platform/settings/subscription"},{"title":"Developer settings","href":"/platform/settings/developer"},{"title":"Email domains","href":"/platform/settings/email-domains"},{"title":"Audit log","href":"/platform/settings/audit-log"}]}]},{"group":"Phone Numbers","icon":{"style":"light","name":"phone"},"pages":[{"title":"Get started with phone numbers","href":"/phone-number/getting-started"},{"title":"Bring Your Own Carrier (BYOC)","href":"/phone-number/byoc"},{"title":"Phone number configuration and assignment","href":"/phone-number/configuration"},{"title":"Branded calling for outbound numbers","href":"/phone-number/branded-calling"},{"title":"Phone number billing and credits","href":"/phone-number/billing-credits"},{"title":"Troubleshoot phone numbers","href":"/phone-number/troubleshooting"}]},{"group":"Genius","icon":{"style":"light","name":"brain"},"pages":[{"title":"Get started with Genius knowledge bases","href":"/genius/getting-started"},{"title":"Data sources for Genius","href":"/genius/sources"},{"title":"Genius knowledge base best practices","href":"/genius/best-practices"},{"title":"Bind Genius knowledge to agents","href":"/genius/agent-binding"},{"title":"Troubleshoot Genius knowledge bases","href":"/genius/troubleshooting"}]},{"group":"Automations","icon":{"style":"light","name":"code-branch"},"pages":[{"title":"Get started with Thoughtly automations","href":"/automations/getting-started"},{"title":"Automation triggers","href":"/automations/triggers"},{"title":"Automation actions and steps","href":"/automations/actions"},{"title":"Attributes vs metadata in automations","href":"/automations/attributes-vs-metadata"},{"title":"Troubleshoot Thoughtly automations","href":"/automations/troubleshooting"}]},{"group":"Resources","icon":{"style":"light","name":"graduation-cap"},"pages":[{"title":"Thoughtly FAQ","href":"/resources/faq"},{"title":"Video library","href":"/resources/video-library"},{"group":"Glossary","pages":[{"title":"Glossary","href":"/resources/glossary/overview"},{"title":"Voice agent","href":"/resources/glossary/voice-agent"},{"title":"Large language model (LLM)","href":"/resources/glossary/large-language-model"},{"title":"TTS (text-to-speech)","href":"/resources/glossary/tts"},{"title":"STT (speech-to-text)","href":"/resources/glossary/stt"},{"title":"Decision tree","href":"/resources/glossary/decision-tree"},{"title":"Happy path","href":"/resources/glossary/happy-path"},{"title":"RAG (retrieval-augmented generation)","href":"/resources/glossary/rag"},{"title":"Screen pop","href":"/resources/glossary/screen-pop"},{"title":"Carrier","href":"/resources/glossary/carrier"},{"title":"CRM","href":"/resources/glossary/crm"},{"title":"Workflow","href":"/resources/glossary/workflow"},{"title":"Variable","href":"/resources/glossary/variable"},{"title":"Transcript","href":"/resources/glossary/transcript"},{"title":"PII (personally identifiable information)","href":"/resources/glossary/pii"},{"title":"Dead end","href":"/resources/glossary/dead-end"},{"title":"OAuth","href":"/resources/glossary/oauth"},{"title":"Twilio","href":"/resources/glossary/twilio"},{"title":"Telnyx","href":"/resources/glossary/telnyx"},{"title":"Hallucination","href":"/resources/glossary/hallucination"},{"title":"AI voice","href":"/resources/glossary/ai-voice"}]},{"title":"Voice agent scheduling guide","href":"/resources/agent-scheduling"},{"title":"Call tagged contacts with an automation","href":"/resources/outbound-automation-tagged-contacts"},{"group":"Whitepapers","pages":[{"title":"Thoughtly whitepapers","href":"/resources/whitepapers/overview"},{"title":"Breaking free from intent-based dialog design","href":"/resources/whitepapers/conversational-ai"},{"title":"So you want to start an AI agency?","href":"/resources/whitepapers/agency-guide"}]}]},{"group":"Support","icon":{"style":"light","name":"life-ring"},"pages":[{"title":"Get support from Thoughtly","href":"/support/getting-help"},{"title":"Changelog","mode":"wide","href":"/support/changelog"},{"title":"Thoughtly referral program","sidebarTitle":"Referral Program","href":"/support/referral-program"}]}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/api-reference/agent/get-agents"}]},{"tab":"Promptbooks","pages":[{"title":"Promptbooks","href":"/promptbooks/browse"}]},{"tab":"Integrations","pages":[{"title":"Integrations","href":"/integrations/getting-started"}]}]},"basePath":"","title":"Code - Thoughtly Docs","buildId":"dpl_GRSyrvXT6FFTpZZTGz5iZPp3D2zE","deploymentId":"dpl_GRSyrvXT6FFTpZZTGz5iZPp3D2zE","dynamics":[],"chunks":[]}