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}`);