---
title: "Workflow"
description: "The `Workflow` entity."
section: "Reference"
group: "Types"
order: 265
---

## Definition

```ts
interface Workflow {
  id: string;
  workspaceId: string;
  name: string;
  description: string | null;
  entryNodeId: string | null;
  outputNodeId: string | null;
  inputSchema: any;
  outputSchema: any;
  createdBy: string;
  runtimeUserId: string | null;
  deletedAt: string | null;
  retentionTier: "short" | "medium" | "long" | "none" | null;
  createdAt: string;
  updatedAt: string;
}
```

## Fields

| Field           | Type                                              | Notes                                                                                                                                                                                                                            |
| --------------- | ------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `id`            | `string`                                          | `readonly` `required`                                                                                                                                                                                                            |
| `workspaceId`   | `string`                                          | `required` — Workspace that owns this workflow.                                                                                                                                                                                  |
| `name`          | `string`                                          | `required` — Human-readable workflow name.                                                                                                                                                                                       |
| `description`   | `string \| null`                                  | `required` — Optional longer-form description.                                                                                                                                                                                   |
| `entryNodeId`   | `string \| null`                                  | `required` — Node where execution begins; null until the graph is assembled.                                                                                                                                                     |
| `outputNodeId`  | `string \| null`                                  | `required` — Node whose output becomes the workflow's return value when run as a typed sync function.                                                                                                                            |
| `inputSchema`   | `any`                                             | `required` — Zod-shaped schema describing the workflow's input contract. Null means untyped (`unknown`).                                                                                                                         |
| `outputSchema`  | `any`                                             | `required` — Zod-shaped schema describing the workflow's output contract. Null means untyped (`unknown`).                                                                                                                        |
| `createdBy`     | `string`                                          | `required` — User who created the workflow.                                                                                                                                                                                      |
| `runtimeUserId` | `string \| null`                                  | `required` — Override the workspace default service user as the runtime caller when this workflow runs headlessly. Null = inherit workspace default. Workspace-admin-only to set; target user must be a member of the workspace. |
| `deletedAt`     | `string \| null`                                  | `required` — ISO-8601 timestamp of soft-delete; null while active. Cleanup worker hard-deletes once `deletedAt + retentionTier.days` passes.                                                                                     |
| `retentionTier` | `"short" \| "medium" \| "long" \| "none" \| null` | `required` — Retention tier snapshotted at delete time. `short`=7d, `medium`=30d, `long`=90d, `none`=never. Null while active.                                                                                                   |
| `createdAt`     | `string`                                          | `readonly` `required` — ISO-8601 timestamp of creation.                                                                                                                                                                          |
| `updatedAt`     | `string`                                          | `readonly` `required` — ISO-8601 timestamp of the last update.                                                                                                                                                                   |
