> 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/mutations/createworkflowsignal.md).

# Create Workflow Signal

createWorkflowSignal Mutation

Creates a new WorkflowSignal that defines an event handler for a workflow.

## Arguments

| Name    | Type                         | Description                                 |
| ------- | ---------------------------- | ------------------------------------------- |
| `input` | `CreateWorkflowSignalInput!` | Input data for creating the workflow signal |

## Return Type

`WorkflowSignal` - The created workflow signal.

## Input Fields

`CreateWorkflowSignalInput`:

| Field          | Type      | Description                                           |
| -------------- | --------- | ----------------------------------------------------- |
| `dataTypeID`   | `UUID`    | Optional data type ID to associate with the signal    |
| `dataTypeSlug` | `String`  | Optional data type slug                               |
| `data`         | `Map`     | Custom data associated with the signal                |
| `eventName`    | `String`  | Name of the event that this signal handles            |
| `start`        | `Boolean` | Whether this signal can start a new workflow instance |
| `workflowID`   | `ID!`     | Required ID of the workflow this signal belongs to    |

## Usage Example

```graphql
mutation {
  createWorkflowSignal(
    input: {
      eventName: "inventory_low_stock",
      start: true,
      workflowID: "workflow_123",
      data: {
        "description": "Triggered when inventory falls below minimum threshold",
        "priority": "high",
        "retry_policy": {
          "max_attempts": 3,
          "backoff_multiplier": 2.0
        },
        "timeout_seconds": 300,
        "required_fields": ["item_id", "current_quantity", "minimum_threshold"]
      },
      dataTypeSlug: "inventory_signal"
    }
  ) {
    id
    eventName
    start
    data
    dataTypeSlug
    createdAt
    createdBy
    workflow {
      id
      name
      active
    }
  }
}
```

## JavaScript Example

```javascript
const CREATE_WORKFLOW_SIGNAL = gql`
  mutation CreateWorkflowSignal($input: CreateWorkflowSignalInput!) {
    createWorkflowSignal(input: $input) {
      id
      eventName
      start
      data
      dataTypeSlug
      createdAt
      createdBy
      workflow {
        id
        name
        active
      }
    }
  }
`;

const { data } = await client.mutate({
  mutation: CREATE_WORKFLOW_SIGNAL,
  variables: {
    input: {
      eventName: "inventory_low_stock",
      start: true,
      workflowID: "workflow_123",
      data: {
        description: "Triggered when inventory falls below minimum threshold",
        priority: "high",
        retry_policy: {
          max_attempts: 3,
          backoff_multiplier: 2.0
        },
        timeout_seconds: 300,
        required_fields: ["item_id", "current_quantity", "minimum_threshold"]
      },
      dataTypeSlug: "inventory_signal"
    }
  }
});

console.log(`Created workflow signal: ${data.createWorkflowSignal.eventName} with ID: ${data.createWorkflowSignal.id}`);
```

## Important Notes

* Workflow signals define the entry points and event handlers for workflows
* Signals with `start: true` can initiate new workflow instances when triggered
* Signals with `start: false` are used for signaling existing workflow instances
* The `eventName` should match the events that will be published in the system
* The `data` field supports flexible JSON structures for signal configuration
* Multiple signals can be associated with the same workflow for different events
* The workflow must exist before creating signals for it


---

# 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/mutations/createworkflowsignal.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.
