> ## 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.

# lifecycle

> A lifecycle belonging to the current tenant, or null if it no longer exists.



**query** `lifecycle(lifecycleId: UUID!): Lifecycle`

## Arguments

**`lifecycleId`**: `UUID!` (required)

Id of the lifecycle (`Lifecycle.lifecycleId`), not the global `id`.

## Returns

`Lifecycle`

**`activeRevision`**: `Long`

Number of the active revision. Null before the first activation.

---

**`cardDefinition`**: `CardDefinition!`

Card definition whose entries the lifecycle assesses.

---

**`cardDefinitionId`**: `String!`

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

---

**`createdAt`**: `DateTime!`

When the lifecycle was created (UTC).

---

**`etag`**: `Etag!`

Version of the lifecycle. Pass it in `etag` to update, delete or activate the lifecycle.

---

**`id`**: `ID!`

Global id of the lifecycle, for refetching it with `node`.

---

**`lifecycleId`**: `UUID!`

Raw id of the lifecycle (a UUID), used in lifecycle mutations and filters.

---

**`pendingDefinition`**: `LifecycleDefinition`

Saved changes not activated yet. Null when there are none.

---

**`revision`**: `LifecycleRevision`

An immutable activated definition, or null if that revision does not exist.

**Arguments:**

- `number`: `Long!` — Revision number, from 1.

---

**`state`**: `LifecycleState!`

Whether the lifecycle is a draft, initializing or ready. See `LifecycleState`.

---

**`updatedAt`**: `DateTime!`

When the lifecycle last changed (UTC).

---

**`updatedBy`**: `UUID!`

Id of the user or application that last changed the lifecycle.

## Examples

```graphql Query
query Lifecycle($lifecycleId: UUID!) {
  lifecycle(lifecycleId: $lifecycleId) {
    activeRevision
    cardDefinition {
      activationStatus {
        status
        steps {
          __typename
        }
      }
      activePropertySet {
        key
        properties {
          __typename
        }
        propertyIds
      }
      allowsEnrichment
      cardsCount
      createdAt
      createdByUser
    }
    cardDefinitionId
    createdAt
    etag
    id
  }
}
```

```json Variables
{
  "lifecycleId": "value"
}
```

```json Response
{
  "data": {
    "lifecycle": {
      "activeRevision": "value",
      "cardDefinition": {
        "activationStatus": {
          "status": "RUNNING",
          "steps": [
            {
              "__typename": "KeyValuePairOfStringAndWorkflowStep"
            }
          ]
        },
        "activePropertySet": {
          "key": "string",
          "properties": [
            {
              "__typename": "CardPropertyDefinition"
            }
          ],
          "propertyIds": [
            "string"
          ]
        },
        "allowsEnrichment": true,
        "cardsCount": "value",
        "createdAt": "value",
        "createdByUser": "value"
      },
      "cardDefinitionId": "string",
      "createdAt": "value",
      "etag": "value",
      "id": "id"
    }
  }
}
```


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