# at.functions.workflow

> Published by [hamburgerz.bsky.social](https://lexicon.garden/identity/did:plc:vsnj4aaxyatiht4spdht2q2t)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:vsnj4aaxyatiht4spdht2q2t/at.functions.workflow)
- [Documentation](https://lexicon.garden/lexicon/did:plc:vsnj4aaxyatiht4spdht2q2t/at.functions.workflow/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:vsnj4aaxyatiht4spdht2q2t/at.functions.workflow/examples)

## Definitions

### `at.functions.workflow`

**Type**: `record`

A named workflow that chains AT Functions, passing outputs as inputs between steps.

**Key**: `tid`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `name` | `string` | Yes |  |
| `steps` | `array` | Yes |  |
| `version` | `string` | Yes |  |
| `description` | `string` | No |  |
| `maxDurationMs` | `integer` | No |  |

### `at.functions.workflow#step`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `id` | `string` | Yes | Unique identifier for this step; used to reference its output in subsequent steps via {{$.id.field}}. |
| `input` | `unknown` | No | JSON object whose string values may contain {{$.input.x}} or {{$.stepId.x}} templates. |
| `function` | `string` (at-uri) | Yes | AT URI of the at.functions.metadata record to invoke. |
| `description` | `string` | No |  |

## Raw Schema

```json
{
  "id": "at.functions.workflow",
  "defs": {
    "main": {
      "key": "tid",
      "type": "record",
      "record": {
        "type": "object",
        "required": [
          "name",
          "version",
          "steps"
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 128
          },
          "steps": {
            "type": "array",
            "items": {
              "ref": "#step",
              "type": "ref"
            },
            "maxItems": 16,
            "minItems": 1
          },
          "version": {
            "type": "string",
            "maxLength": 32
          },
          "description": {
            "type": "string",
            "maxLength": 1024
          },
          "maxDurationMs": {
            "type": "integer",
            "maximum": 300000,
            "minimum": 100
          }
        }
      },
      "description": "A named workflow that chains AT Functions, passing outputs as inputs between steps."
    },
    "step": {
      "type": "object",
      "required": [
        "id",
        "function"
      ],
      "properties": {
        "id": {
          "type": "string",
          "maxLength": 64,
          "description": "Unique identifier for this step; used to reference its output in subsequent steps via {{$.id.field}}."
        },
        "input": {
          "type": "unknown",
          "description": "JSON object whose string values may contain {{$.input.x}} or {{$.stepId.x}} templates."
        },
        "function": {
          "type": "string",
          "format": "at-uri",
          "description": "AT URI of the at.functions.metadata record to invoke."
        },
        "description": {
          "type": "string",
          "maxLength": 256
        }
      }
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
