Code component
Code for customer-owned automation.
Use Code when a workflow needs a small governed script that reads workflow context, transforms data, and returns a result before the next step.
Write, test, and run JavaScript or TypeScript inside a workflow with context access and platform logs.
1// Read workflow context
2const payload = context.input;
3const normalized = normalize(payload.customer);
4const route = context.variables.intent;
5
6return {
7 status: "ready",
8 customer: normalized,
9 nextStep: route
10};
What this component unlocks
Use Code as a visible flow step.
The docs describe Code as a syntax-highlighted editor for JavaScript and TypeScript with IntelliSense, suggestions for internal objects and actions, common libraries like lodash and moment.js, and automatic TypeScript transpilation when code is saved. Code runs synchronously: the workflow pauses until the script finishes, execution is limited to 1 second, errors are captured clearly, and log statements are visible in the platform Logs panel. Builders can use the context object to access workflow state, variables, and data from other components before returning structured output to the next step.
Visual code editor
Write JavaScript or TypeScript with syntax highlighting, IntelliSense, editor resizing, and save-time TypeScript transpilation.
Workflow context access
Read and manipulate workflow state, variables, and prior component data through the context object.
Testing, logs, and feedback
Test before saving, send log statements to the Logs panel, and review transpilation or runtime errors.
Use cases
Where Code fits in automation.
These examples show how this component can become part of production workflows across customer-owned systems and environments.
Context-based transformation
Use Code as part of a governed CXFabric workflow that keeps configuration, credentials, logs, and handoffs visible.
- Collect the approved input
- Apply customer-specific rules
- Pass a clear result to the next step
Custom validation
Use Code as part of a governed CXFabric workflow that keeps configuration, credentials, logs, and handoffs visible.
- Collect the approved input
- Apply customer-specific rules
- Pass a clear result to the next step
JSON formatting
Use Code as part of a governed CXFabric workflow that keeps configuration, credentials, logs, and handoffs visible.
- Collect the approved input
- Apply customer-specific rules
- Pass a clear result to the next step
Synchronous decision support
Use Code as part of a governed CXFabric workflow that keeps configuration, credentials, logs, and handoffs visible.
- Collect the approved input
- Apply customer-specific rules
- Pass a clear result to the next step
Small calculation
Use Code as part of a governed CXFabric workflow that keeps configuration, credentials, logs, and handoffs visible.
- Collect the approved input
- Apply customer-specific rules
- Pass a clear result to the next step
Prototype connector behavior
Use Code as part of a governed CXFabric workflow that keeps configuration, credentials, logs, and handoffs visible.
- Collect the approved input
- Apply customer-specific rules
- Pass a clear result to the next step
Configuration surface
Practical options builders expect to use.
The exact fields can vary by deployment and product version, but each page gives customers a clear view of the component's intended role.
Add Code to the canvas
Expose this behavior as a reusable, logged, credential-aware step inside a CXFabric flow.
Open component settings
Expose this behavior as a reusable, logged, credential-aware step inside a CXFabric flow.
Choose JavaScript or TypeScript
Expose this behavior as a reusable, logged, credential-aware step inside a CXFabric flow.
Write logic using context
Expose this behavior as a reusable, logged, credential-aware step inside a CXFabric flow.
Test before saving
Expose this behavior as a reusable, logged, credential-aware step inside a CXFabric flow.
Review logs and error feedback
Expose this behavior as a reusable, logged, credential-aware step inside a CXFabric flow.
Implementation notes
Design the step with operations in mind.
Components should be easy for builders to configure and easy for operators to understand after the workflow is live.
Current CXFabric docs
Code execution is synchronous and limited to 1 second
Code execution is synchronous and limited to 1 second.
CXFabric approachMake the behavior explicit in the workflow so operators can see what happens before and after this component runs.
Use the context object to reference prior component data and workflow variables
Use the context object to reference prior component data and workflow variables.
CXFabric approachMake the behavior explicit in the workflow so operators can see what happens before and after this component runs.
Keep scripts focused; promote repeated logic into reusable components or connectors
Keep scripts focused; promote repeated logic into reusable components or connectors.
CXFabric approachMake the behavior explicit in the workflow so operators can see what happens before and after this component runs.
Workflow patterns
Reusable patterns for Code.
These are concept patterns that can be adapted to a customer's systems, policies, credentials, and deployment model.
Code in a customer intake flow
Start with an event, use Code, then route the result to CRM, ticketing, or a customer-owned system.
Code with approval and audit
Add validation, human approval, and logging around the component before downstream actions execute.
Code in a private runtime
Deploy the component inside a customer-owned environment with credentials and logs governed by the customer.
Code plus custom connector
Combine the component with packaged connectors or custom APIs when the process needs reusable system logic.
Component planning
Need Code inside a customer workflow?
We can scope the workflow, component configuration, credentials, deployment model, and handoff path before buildout begins.