> 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/queries/workflowassignee.md).

# WorkflowAssignee

Retrieve the assignee of a specific workflow run

Audience: Programmer

Retrieves the assignee for a specific workflow run. This query fetches the assignee information from the workflow's search attributes in the Temporal workflow engine, providing visibility into who is responsible for a particular workflow execution.

## Arguments

| Name    | Type                | Description                                      |
| ------- | ------------------- | ------------------------------------------------ |
| `input` | `GetAssigneeInput!` | Input containing workflow identifiers (required) |

### GetAssigneeInput Fields

| Field           | Type      | Description                                   |
| --------------- | --------- | --------------------------------------------- |
| `workflowID`    | `String!` | The unique identifier of the workflow         |
| `workflowRunID` | `String!` | The specific run ID of the workflow execution |

## Return Type

`GetAssigneeResponse!` - Response containing the assignee information (non-nullable)

### GetAssigneeResponse Fields

| Field      | Type      | Description                                      |
| ---------- | --------- | ------------------------------------------------ |
| `assignee` | `String!` | The ID of the user assigned to this workflow run |

## Usage Example

### GraphQL Query

```graphql
query GetWorkflowAssignee {
  workflowAssignee(input: {
    workflowID: "order-processing-workflow-123"
    workflowRunID: "run-456-xyz"
  }) {
    assignee
  }
}
```

### JavaScript Example

```javascript
const query = `
  query GetWorkflowAssignee($input: GetAssigneeInput!) {
    workflowAssignee(input: $input) {
      assignee
    }
  }
`;

const variables = {
  input: {
    workflowID: "order-processing-workflow-123",
    workflowRunID: "run-456-xyz"
  }
};

// Using fetch API
const response = await fetch('/graphql', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': `Bearer ${token}`
  },
  body: JSON.stringify({
    query,
    variables
  })
});

const result = await response.json();
console.log('Assignee:', result.data.workflowAssignee.assignee);
```

## Response Example

```json
{
  "data": {
    "workflowAssignee": {
      "assignee": "user-12345"
    }
  }
}
```

## Error Handling

The query may return errors in the following cases:

### Invalid WorkflowID

```json
{
  "errors": [{
    "message": "invalid WorkflowID",
    "path": ["workflowAssignee"]
  }]
}
```

### Invalid WorkflowRunID

```json
{
  "errors": [{
    "message": "invalid WorkflowRunID",
    "path": ["workflowAssignee"]
  }]
}
```

### Workflow Not Found

```json
{
  "errors": [{
    "message": "workflow not found: order-processing-workflow-123",
    "path": ["workflowAssignee"]
  }]
}
```

### Invalid Workflow Client

```json
{
  "errors": [{
    "message": "invalid workflowClient",
    "path": ["workflowAssignee"]
  }]
}
```

## Notes

* The assignee is stored in the workflow's search attributes under the key `pyck_workflow_assignee`
* If no assignee is set for the workflow, the query returns an empty string
* Requires valid authentication and appropriate tenant context
* The workflow must exist in the Temporal workflow engine for the query to succeed
* This query is useful for tracking responsibility and routing work items in workflow-driven processes
* The assignee ID typically corresponds to a user in the system's identity management (Zitadel)

## Related Types

* [GetAssigneeInput](/graphql-api/inputs/getassigneeinput.md)
* [GetAssigneeResponse](/graphql-api/types/getassigneeresponse.md)

## Related Mutations

* `setWorkflowAssignee` - Set or update the assignee for a workflow run

## Service

This query is provided by the **workflow** service as part of the federated GraphQL schema.


---

# 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/queries/workflowassignee.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.
