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

# Workflow preferences examples

# Workflow Preferences Examples

## All Channels Enabled, Subscriber-Editable

```typescript theme={null}
import { workflow } from "@novu/framework";

const myWorkflow = workflow("general-notification", execute, {
  preferences: {
    all: { enabled: true, readOnly: false },
  },
});
```

## Specific Channels Only

```typescript theme={null}
const emailOnlyWorkflow = workflow("weekly-report", execute, {
  preferences: {
    all: { enabled: false },
    channels: {
      email: { enabled: true },
    },
  },
});
```

## Critical Notification (Read-Only)

```typescript theme={null}
const securityAlertWorkflow = workflow("security-alert", execute, {
  preferences: {
    all: { enabled: true, readOnly: true },
  },
});
```

## Mixed Channel Defaults

```typescript theme={null}
const orderUpdateWorkflow = workflow("order-update", execute, {
  preferences: {
    all: { enabled: true, readOnly: false },
    channels: {
      email: { enabled: true },
      sms: { enabled: false },     // off by default, subscriber can enable
      push: { enabled: true },
      chat: { enabled: false },
      inApp: { enabled: true },
    },
  },
});
```

## In-App + Email Default

```typescript theme={null}
const commentWorkflow = workflow("new-comment", execute, {
  preferences: {
    all: { enabled: false },
    channels: {
      email: { enabled: true },
      inApp: { enabled: true },
    },
  },
});
```

## All Channels Disabled by Default

Subscribers must opt in:

```typescript theme={null}
const optInWorkflow = workflow("beta-updates", execute, {
  preferences: {
    all: { enabled: false, readOnly: false },
  },
});
```
