> For the complete documentation index, see [llms.txt](https://docs.pyck.cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pyck.cloud/graphql-api/types/workflow.md).

# Workflow

Workflow Type

Represents a workflow definition in the system. Workflows define automated processes that can be triggered by events and executed using Temporal.io.

## Fields

| Field          | Type      | Description                                     |
| -------------- | --------- | ----------------------------------------------- |
| `id`           | `ID!`     | Unique identifier of the workflow               |
| `tenantID`     | `UUID!`   | Tenant identifier                               |
| `dataTypeID`   | `UUID`    | Data type identifier for custom data validation |
| `dataTypeSlug` | `String`  | Data type slug for custom data validation       |
| `data`         | `Map`     | Custom data associated with the workflow        |
| `createdAt`    | `Time!`   | Creation timestamp                              |
| `createdBy`    | `UUID!`   | User identifier who created the workflow        |
| `updatedAt`    | `Time`    | Last update timestamp                           |
| `updatedBy`    | `UUID`    | User identifier who last updated the workflow   |
| `deletedAt`    | `Time`    | Deletion timestamp                              |
| `deletedBy`    | `UUID`    | User identifier who deleted the workflow        |
| `name`         | `String!` | Name of the workflow                            |
| `taskQueue`    | `String!` | Temporal task queue for this workflow           |

## Connection Fields

The `workflowSignals` field returns a Connection object that supports pagination, filtering, and ordering.

### workflowSignals Connection

```graphql
workflowSignals(
  after: Cursor
  first: Int
  before: Cursor
  last: Int
  orderBy: WorkflowSignalOrder
  where: WorkflowSignalWhereInput
): WorkflowSignalConnection!
```

| Argument  | Type                       | Description                            |
| --------- | -------------------------- | -------------------------------------- |
| `after`   | `Cursor`                   | Returns elements after this cursor     |
| `first`   | `Int`                      | Returns the first n elements           |
| `before`  | `Cursor`                   | Returns elements before this cursor    |
| `last`    | `Int`                      | Returns the last n elements            |
| `orderBy` | `WorkflowSignalOrder`      | Ordering options for workflow signals  |
| `where`   | `WorkflowSignalWhereInput` | Filtering options for workflow signals |

## Interfaces

* `Node`

## Usage Example

```graphql
query {
  workflows(first: 10) {
    edges {
      node {
        id
        name
        taskQueue
        workflowSignals(first: 20) {
          edges {
            node {
              id
              natsTopic
              temporalSignal
              temporalSignalType
            }
          }
          pageInfo {
            hasNextPage
            endCursor
          }
          totalCount
        }
        data
        createdAt
        updatedAt
      }
    }
  }
}
```

### Query with Filtering on Signals

```graphql
query {
  workflows(first: 10) {
    edges {
      node {
        id
        name
        workflowSignals(
          first: 10
          where: { temporalSignalType: start }
          orderBy: { direction: ASC, field: NATS_TOPIC }
        ) {
          edges {
            node {
              id
              natsTopic
              temporalSignalType
            }
          }
          totalCount
        }
      }
    }
  }
}
```

## Relations

* **Workflow** `1:N` **WorkflowSignal**: A workflow can have multiple signals that trigger it

## Purpose

Workflows represent automated business processes that are executed using Temporal.io. They can be triggered by events through WorkflowSignals and can include custom data validation through DataTypes. The `taskQueue` field specifies which Temporal task queue processes this workflow.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.pyck.cloud/graphql-api/types/workflow.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
