---
alias: "fc.workflow.provider"
aliases:
  - fc.workflow.provider
category: layout
module: Core
---

# fc.workflow.provider

Data provider that fetches all workflows across all retailers and passes them as data context to its first descendant.

## When to Use
- Build a workflow management or listing page that needs access to all workflows in the account
- Provide workflow data context to downstream components like `fc.list` or `fc.card.attribute`
- Create a workflow explorer or configuration page

## Key Props

This component has no props. It fetches workflow data automatically on mount.

## Data Binding
Fetches workflows via the Fluent REST API (`/api/v4.1/workflow`) for each retailer the user has access to. The workflow data includes:
- `name` -- workflow name
- `version` -- workflow version string
- `entityType` -- target entity type (e.g. ORDER, FULFILMENT)
- `entitySubtype` -- entity subtype (e.g. HD, CC)
- `description` -- workflow description
- `createdBy` -- creator username
- `createdOn` -- creation timestamp
- `retailer` -- retailer ID
- `versionComment` -- optional version comment

The fetched workflows are passed to the first descendant via `dataOverride`.

## Descendants
Yes -- renders its first descendant (`index={0}`) with the workflow data injected as `dataOverride`. Shows a loading spinner while data is being fetched. Displays an error message if the fetch fails.

## Composition Patterns
- `fc.page` > `fc.workflow.provider` > `fc.list` for a workflow listing page
- `fc.page` > `fc.workflow.provider` > `fc.tabs.card` > workflow category tabs

## Gotchas
- Only the first descendant (`index={0}`) receives the data -- additional descendants are ignored.
- Fetches workflows for ALL retailers the user has access to, not just the active retailer. This can be slow on accounts with many retailers.
- Uses `@tanstack/react-query` for caching -- subsequent renders may use cached data.
- The REST API call uses `latest=true&count=100` -- only the latest version of each workflow is returned, up to 100 per retailer.
- Shows a loading spinner during fetch and an error message on failure -- no descendant is rendered until data is available.
- Registered with category `content` in the component registry.

## Manifest Example
```json
{
  "component": "fc.workflow.provider",
  "descendants": [
    {
      "component": "fc.list",
      "props": {
        "attributes": [
          { "label": "Name", "value": "{{name}}" },
          { "label": "Entity Type", "value": "{{entityType}}" },
          { "label": "Subtype", "value": "{{entitySubtype}}" },
          { "label": "Version", "value": "{{version}}" },
          { "label": "Retailer", "value": "{{retailer}}" }
        ],
        "defaultPageSize": 25
      }
    }
  ]
}
```

## AI Parse Notes
- **Primary intent:** Declarative Mystique component definition for manifests.
- **Selection signals:** Match by `alias`, category, and required `Key Props`.
- **Assembly hints:** Combine with compatible parent/child components listed in `Composition Patterns`.
- **Safety checks:** Validate required props and data bindings before manifest generation.
