> ## Documentation Index
> Fetch the complete documentation index at: https://docs.attio.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Config schema

> Node types for declaring configurable fields in a workflow block

The config schema declares the fields that `configurator.tsx` must render inputs for. It is declared in `block.ts` via the `configSchema` field of `Workflows.defineWorkflowBlock`, and is the source of truth for the typed `config` argument your handlers receive.

Every schema must be rooted in a `struct` node. Node types are accessed via `Workflows.ConfigSchema`.

## Composite nodes

| Factory | Description |
| - | - |
| `ConfigSchema.struct(fields)` | Root of every config schema. Each key is a field name; each value is a node. All handler `config` arguments are typed from the `struct` at the schema root. |
| `ConfigSchema.array(element)` | A repeating list of values of the given node type. The `config` property is typed as an array of the element's TypeScript type. |

## Primitive nodes

| Factory | TypeScript type | Description |
| - | - | - |
| `ConfigSchema.string()` | `WorkflowBlockConfigStringNode` | Free-form text |
| `ConfigSchema.number()` | `WorkflowBlockConfigNumberNode` | Numeric value |
| `ConfigSchema.boolean()` | `WorkflowBlockConfigBooleanNode` | True/false toggle |
| `ConfigSchema.stringEnum(values)` | `WorkflowBlockConfigStringEnumNode` | One value from a fixed list of strings |
| `ConfigSchema.richText()` | `WorkflowBlockConfigRichTextNode` | Formatted text (not available in [Outcome schema](./outcome-schema)) |

## Date and time nodes

| Factory | TypeScript type | Description |
| - | - | - |
| `ConfigSchema.date()` | `WorkflowBlockConfigDateNode` | Calendar date without time |
| `ConfigSchema.timestamp()` | `WorkflowBlockConfigTimestampNode` | Point in time (date + time + timezone) |
| `ConfigSchema.duration()` | `WorkflowBlockConfigDuration` | Length of time |

## Contact and identity nodes

| Factory | TypeScript type | Description |
| - | - | - |
| `ConfigSchema.emailAddress()` | `WorkflowBlockConfigEmailAddress` | Email address |
| `ConfigSchema.phoneNumber()` | `WorkflowBlockConfigPhoneNumber` | Phone number |
| `ConfigSchema.personalName()` | `WorkflowBlockConfigPersonalNameNode` | First and last name |
| `ConfigSchema.domain()` | `WorkflowBlockConfigDomain` | Web domain (e.g. `attio.com`) |
| `ConfigSchema.location()` | `WorkflowBlockConfigLocation` | Geographic location |
| `ConfigSchema.currency()` | `WorkflowBlockConfigCurrency` | Monetary value with currency code |

## Attio object nodes

| Factory | TypeScript type | Description |
| - | - | - |
| `ConfigSchema.attioRecord()` | `WorkflowBlockConfigAttioRecord` | Reference to an Attio record |
| `ConfigSchema.attioObject()` | `WorkflowBlockConfigAttioObject` | Reference to an Attio object type |
| `ConfigSchema.attioList()` | `WorkflowBlockConfigAttioList` | Reference to an Attio list |
| `ConfigSchema.attioActor()` | `WorkflowBlockConfigAttioActor` | Reference to an Attio actor (user or workspace member) |
| `ConfigSchema.attioAttribute()` | `WorkflowBlockConfigAttioAttribute` | Reference to an attribute on an Attio object |
| `ConfigSchema.attioSelect()` | `WorkflowBlockConfigAttioSelect` | Select value from an Attio attribute |
| `ConfigSchema.attioSequence()` | `WorkflowBlockConfigAttioSequence` | Reference to an Attio sequence |
| `ConfigSchema.attioTask()` | `WorkflowBlockConfigAttioTask` | Reference to an Attio task |

## Example

```ts block.ts theme={"system"}
import {Workflows} from "attio"

export default Workflows.defineWorkflowBlock({
  type: "step",
  id: "send-email",
  title: "Send email",
  description: "Send an email to a contact.",
  configSchema: Workflows.ConfigSchema.struct({
    recipient: Workflows.ConfigSchema.emailAddress(),
    subject: Workflows.ConfigSchema.string(),
    body: Workflows.ConfigSchema.richText(),
    send_at: Workflows.ConfigSchema.timestamp(),
  }),
})
```

## See also

* [Block definition](./define-workflow-block): block identity and config schema
* [Outcome schema](./outcome-schema): typing the data field in return values


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.