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

# lifecycles

> Lists the lifecycles of a card definition, with optional filters and ordering. Ties are broken by id.



**query** `lifecycles(after: String, before: String, cardDefinitionId: String!, first: Int, last: Int, order: [LifecycleSortInput!], where: LifecycleDefinitionFilterInput): LifecyclesConnection`

## Arguments

**`after`**: `String`

Returns the elements in the list that come after the specified cursor.

---

**`before`**: `String`

Returns the elements in the list that come before the specified cursor.

---

**`cardDefinitionId`**: `String!` (required)

Raw id of the card definition (e.g. `products`), not the global `CardDefinition.id`.

---

**`first`**: `Int`

Returns the first _n_ elements from the list.

---

**`last`**: `Int`

Returns the last _n_ elements from the list.

---

**`order`**: `[LifecycleSortInput!]`

---

**`where`**: `LifecycleDefinitionFilterInput`

## Returns

`LifecyclesConnection`

**`edges`**: `[LifecyclesEdge!]`

A list of edges.

---

**`nodes`**: `[Lifecycle!]`

A flattened list of the nodes.

---

**`pageInfo`**: `PageInfo!`

Information to aid in pagination.

## Examples

```graphql Query
query Lifecycles($cardDefinitionId: String!) {
  lifecycles(cardDefinitionId: $cardDefinitionId) {
    edges {
      cursor
      node {
        activeRevision
        cardDefinition {
          __typename
        }
        cardDefinitionId
        createdAt
        etag
        id
      }
    }
    nodes {
      activeRevision
      cardDefinition {
        activationStatus {
          __typename
        }
        activePropertySet {
          __typename
        }
        allowsEnrichment
        cardsCount
        createdAt
        createdByUser
      }
      cardDefinitionId
      createdAt
      etag
      id
    }
    pageInfo {
      endCursor
      hasNextPage
      hasPreviousPage
      startCursor
    }
  }
}
```

```json Variables
{
  "cardDefinitionId": "string"
}
```

```json Response
{
  "data": {
    "lifecycles": {
      "edges": [
        {
          "cursor": "string",
          "node": {
            "activeRevision": "value",
            "cardDefinition": {
              "__typename": "CardDefinition"
            },
            "cardDefinitionId": "string",
            "createdAt": "value",
            "etag": "value",
            "id": "id"
          }
        }
      ],
      "nodes": [
        {
          "activeRevision": "value",
          "cardDefinition": {
            "activationStatus": {
              "__typename": "WorkflowStatus"
            },
            "activePropertySet": {
              "__typename": "PropertySet"
            },
            "allowsEnrichment": true,
            "cardsCount": "value",
            "createdAt": "value",
            "createdByUser": "value"
          },
          "cardDefinitionId": "string",
          "createdAt": "value",
          "etag": "value",
          "id": "id"
        }
      ],
      "pageInfo": {
        "endCursor": "string",
        "hasNextPage": true,
        "hasPreviousPage": true,
        "startCursor": "string"
      }
    }
  }
}
```


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