> 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/enums/workflowtarget.md).

# WorkflowTarget

Client surfaces a workflow can target

Audience: Programmer

Enum representing the client surfaces a workflow execution can target. Used as values of the `pyck_workflow_targets` KeywordList search attribute in Temporal.

A workflow may declare zero, one, or multiple targets. Queries can filter on any subset via the `targets` and `targetsNotIn` predicates on `WorkflowExecutionsWhereInput`.

## Values

| Value    | Description                                     |
| -------- | ----------------------------------------------- |
| `WEB`    | Workflow targets the web client surface         |
| `MOBILE` | Workflow targets the mobile client surface      |
| `SETUP`  | Workflow targets the setup/admin client surface |

## Search Attribute Semantics

The `WorkflowTarget` values are stored in Temporal's `pyck_workflow_targets` KeywordList search attribute. KeywordList semantics mean:

* A single workflow execution can be tagged with multiple targets simultaneously
* Filtering with `targets` matches workflows whose target list contains **any** element of the supplied set
* Filtering with `targetsNotIn` excludes workflows whose target list contains any element of the supplied set
* Passing an empty list to `setWorkflowTargets` clears the search attribute, so the workflow no longer matches any targets-based filter

## Usage Examples

### Filtering Workflow Executions by Target

```graphql
query {
  workflowExecutions(
    where: {
      targets: [WEB, MOBILE]
      status: "RUNNING"
    }
    first: 50
  ) {
    edges {
      node {
        execution {
          workflowId
          id
        }
        status
      }
    }
    totalCount
  }
}
```

### Excluding Targets

```graphql
query {
  workflowExecutions(
    where: {
      targetsNotIn: [SETUP]
    }
    first: 100
  ) {
    edges {
      node {
        execution {
          workflowId
        }
        status
      }
    }
  }
}
```

### Reading Current Targets

```graphql
query {
  workflowTargets(input: {
    workflowId: "picking-order-12345"
    workflowExecutionId: "run-abc-123"
  }) {
    targets
  }
}
```

### Setting Targets

```graphql
mutation {
  setWorkflowTargets(input: {
    workflowId: "picking-order-12345"
    workflowExecutionId: "run-abc-123"
    targets: [WEB, MOBILE]
  }) {
    targets
  }
}
```

## JavaScript Example

```javascript
// Using the enum in variables
const variables = {
  input: {
    workflowId: "picking-order-12345",
    workflowExecutionId: "run-abc-123",
    targets: ["WEB", "MOBILE"]
  }
};

const SET_TARGETS = gql`
  mutation SetTargets($input: SetWorkflowTargetsInput!) {
    setWorkflowTargets(input: $input) {
      targets
    }
  }
`;

const { data } = await client.mutate({
  mutation: SET_TARGETS,
  variables
});

console.log(`Targets: ${data.setWorkflowTargets.targets.join(", ")}`);
```

## Notes

* Enum values are case-sensitive and must be uppercase (`WEB`, `MOBILE`, `SETUP`)
* A workflow with no targets declared returns an empty list when queried via `workflowTargets`
* Setting targets requires the workflow's state to implement the `WorkflowTargetsSetter` SDK interface
* KeywordList filtering is performed at the Temporal level for efficient indexed lookups

## Related Documentation

* Query: [workflowTargets](/graphql-api/queries/workflowtargets.md)
* Mutation: [setWorkflowTargets](/graphql-api/mutations/setworkflowtargets.md)
* Input: [GetWorkflowTargetsInput](/graphql-api/inputs/getworkflowtargetsinput.md)
* Input: [SetWorkflowTargetsInput](/graphql-api/inputs/setworkflowtargetsinput.md)
* Type: [GetWorkflowTargetsResponse](/graphql-api/types/getworkflowtargetsresponse.md)
* Type: [SetWorkflowTargetsResponse](/graphql-api/types/setworkflowtargetsresponse.md)
* Query: [workflowExecutions](/graphql-api/queries/workflowexecutions.md)

## Service

This enum is defined in 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/enums/workflowtarget.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.
