Code component

Component Code Governed workflow step Customer-owned runtime

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.

Code Editor + runtime
code-step.ts tested
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};
Input Workflow context Customer payload, variables, and prior step output.
Runtime 1s synchronous step Run inside the governed CXFabric workflow execution.
Output Structured result Returned to the next component or connector action.

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.

Component

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
Component

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
Component

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
Component

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
Component

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
Component

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.

Component

Add Code to the canvas

Expose this behavior as a reusable, logged, credential-aware step inside a CXFabric flow.

Component

Open component settings

Expose this behavior as a reusable, logged, credential-aware step inside a CXFabric flow.

Component

Choose JavaScript or TypeScript

Expose this behavior as a reusable, logged, credential-aware step inside a CXFabric flow.

Component

Write logic using context

Expose this behavior as a reusable, logged, credential-aware step inside a CXFabric flow.

Component

Test before saving

Expose this behavior as a reusable, logged, credential-aware step inside a CXFabric flow.

Component

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.

Planning note

Code execution is synchronous and limited to 1 second

Code execution is synchronous and limited to 1 second.

CXFabric approach

Make the behavior explicit in the workflow so operators can see what happens before and after this component runs.

Planning note

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 approach

Make the behavior explicit in the workflow so operators can see what happens before and after this component runs.

Planning note

Keep scripts focused; promote repeated logic into reusable components or connectors

Keep scripts focused; promote repeated logic into reusable components or connectors.

CXFabric approach

Make 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.

We will use this to follow up about your CXFabric workflow.