# Workflow design

> Flow definitions, versions, publishing, deployments, triggers and the operator catalog.

Source: https://docs.sommatic.ai/en/api/reference/workflow-design/

## Get an flow version by query selector.

`GET /workflow-orchestration/control-plane/flow-compilation/flow-version/{queryselector}`

Returns the FlowVersion information that matches the query selector an search specified in the route.

Authentication: Bearer token

### Parameters

- `queryselector` (path, enum, required): Is the filter available for this query Allowed values: `id`, `organization-id`, `flow-definition-id`, `all`.
- `search` (query, string): Keyword to search for entities.
- `include_status` (query, string): Optional status parameter to include flow versions of a specific status.
- `exclude_status` (query, string): Optional status parameter to exclude flow versions of a specific status.
- `page` (query, integer): Page number, starting at 1 (default 1).
- `pageSize` (query, integer): Records per page (default 25).

### Responses

- `200`: OK.
- `500`: Something was wrong while you make this action.

### Example request

```bash
curl -X GET "https://api.sommatic.ai/workflow-orchestration/control-plane/flow-compilation/flow-version/<queryselector>" \
  -H "Authorization: Bearer $SOMMATIC_TOKEN"
```

## Create a new flow definition.

`POST /workflow-orchestration/control-plane/flow-design/flow-definition/`

Returns the created flow definition with data provided.

Authentication: Bearer token

### Request body

FlowDefinition object to be created.

- `name` (string, required): Human-readable name of the flow definition shown in Sommatic AI.
- `slug` (string, required): Stable semantic key that identifies the logical flow across multiple versions and deployments.
- `description` (string): Longer free-text description that explains the business and operational purpose of the flow.
- `business_purpose` (string): Concise statement of what organizational function or outcome this flow is intended to support.
- `cognitive_role` (string): High-level role of this flow within the organizational cognition landscape, for example "orchestration", "monitoring", "remediation", "classification" or "decision_support".
- `category` (string): Optional category or domain label used to group related flows in the Sommatic AI workspace.
- `tags` (array<string>): Optional list of tags used to categorize, search and filter flow definitions.
- `organization_id` (string, required): Identifier of the organization (tenant) that owns this flow definition.
- `project_id` (string, required): Identifier of the project used to group this flow with related automation assets.
- `draft_graph` (object): Directed acyclic graph describing the draft flow structure for this definition.
  - `nodes` (array<NodeDefinitionModel>): List of NodeDefinitionModel instances that define the node-level behavior of this flow definition.
  - `edges` (array<NodeEdgeModel>): List of NodeEdgeModel instances that encode control flow between nodes in this definition.
- `trigger_ids` (array<string>): List of TriggerModel identifiers that can start or resume this flow definition.
- `default_trigger_id` (string): Identifier of the TriggerModel that should be used as the default entry point for this flow.
- `primary_agent_profile_id` (string): Identifier of the main AgentProfileModel that provides default AI behavior for this flow.
- `agent_profile_ids` (array<string>): Optional list of AgentProfileModel identifiers that may participate in this flow when executed as a multi-agent orchestration.
- `supports_concurrent_instances` (boolean): Indicates whether multiple instances of this flow can run in parallel for the same business context.
- `max_concurrent_instances` (integer): Optional upper bound on the number of concurrent instances allowed for this flow definition.
- `default_timeout_ms` (integer): Optional default execution timeout in milliseconds applied to flow instances if no per-node timeout is set.
- `default_retry_policy` (object): Optional default retry policy applied at the flow level, providing baseline behavior for node retries when specific nodes do not override it. Typically includes max attempts and backoff strategy.
- `editor_state` (object): Optional persisted editor state such as canvas position, zoom level and node coordinates that allows the visual builder to restore the last layout used by the designer.
- `latest_version_id` (string): Identifier of the latest FlowVersionModel compiled from this definition, if any.
- `version_counter` (integer): Monotonic counter used to generate sequential FlowVersionModel versions from this definition.
- `compiler_hints` (object): Optional compiler hints and optimization flags that influence how this definition is translated into FlowVersionModel instances, such as preferred worker pools or execution strategies.
- `execution_state` (object): Operational gate that controls whether the flow accepts new executions, broken down by execution mode (test, prod). When `paused: true` for a given mode, all dispatch entrypoints (webhook, chain, scheduled, manual) skip orchestrator execution. In test mode, no FlowInstance is created (423 Locked). In prod mode, a FlowInstance with status `paused` is created for audit, and the orchestrator is NOT invoked.
  - `test` (object)
    - `paused` (boolean)
    - `paused_at` (string)
    - `paused_by` (string)
    - `paused_reason` (string)
  - `prod` (object)
    - `paused` (boolean)
    - `paused_at` (string)
    - `paused_by` (string)
    - `paused_reason` (string)
- `output_config` (array<object>): Configuration that defines which node outputs should be surfaced as the meaningful result when viewing workflow run outcomes. Each entry pins a specific node and controls what data (output, metrics, meta) is extracted and displayed.
  - `node_id` (string): Identifier of the node whose output should be included in the configured result.
  - `label` (string): Human-readable label for this output entry shown in the result view.
  - `display` (string): Display mode — "full" for entire output or "fields" for specific field selection.
  - `fields` (array<string>): When display is "fields", the list of output field names to extract.
  - `include_metrics` (boolean): Whether to include execution metrics (latency, token usage) for this node.
  - `include_meta` (boolean): Whether to include the meta object (evaluation details, routing decisions).
  - `order` (integer): Display order in the result view (lower values first).
- `git_binding` (object): Link with the Git repository this resource is synchronized from (see docs/concepts/git_sync.md): { repository_id, repository, branch, environment, package_path, resource_key, file_path,
  last_synced_commit, last_synced_at, deployed_commit, deployed_at, deployed_version, unlinked,
  unlinked_at }. unlinked = true means this installation stops syncing the resource from Git.
- `persistence_store_id` (string): Optional reference to a Payload Store (WorkflowOrchestrationMemoryStore) that defines where heavy execution payloads of this workflow are externalized. When set, string values above the store's thresholds are uploaded to the referenced blob storage (content-addressed by SHA-256) and replaced in execution documents by a `$payloadRef` descriptor. When null or absent, heavy values are truncated to an ephemeral preview (`_truncated` marker) — the workflow runs without any storage dependency.

### Responses

- `200`: OK.
- `500`: Something was wrong while you make this action.

### Example request

```bash
curl -X POST "https://api.sommatic.ai/workflow-orchestration/control-plane/flow-design/flow-definition/" \
  -H "Authorization: Bearer $SOMMATIC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
       "name": "<name>",
       "slug": "<slug>",
       "organization_id": "<organization_id>",
       "project_id": "<project_id>"
     }'
```

## Update an existing flow definition.

`PATCH /workflow-orchestration/control-plane/flow-design/flow-definition/`

Updates the data of an existing flow definition with the data provided.

Authentication: Bearer token

### Request body

FlowDefinition object to be created.

- `name` (string, required): Human-readable name of the flow definition shown in Sommatic AI.
- `slug` (string, required): Stable semantic key that identifies the logical flow across multiple versions and deployments.
- `description` (string): Longer free-text description that explains the business and operational purpose of the flow.
- `business_purpose` (string): Concise statement of what organizational function or outcome this flow is intended to support.
- `cognitive_role` (string): High-level role of this flow within the organizational cognition landscape, for example "orchestration", "monitoring", "remediation", "classification" or "decision_support".
- `category` (string): Optional category or domain label used to group related flows in the Sommatic AI workspace.
- `tags` (array<string>): Optional list of tags used to categorize, search and filter flow definitions.
- `organization_id` (string, required): Identifier of the organization (tenant) that owns this flow definition.
- `project_id` (string, required): Identifier of the project used to group this flow with related automation assets.
- `draft_graph` (object): Directed acyclic graph describing the draft flow structure for this definition.
  - `nodes` (array<NodeDefinitionModel>): List of NodeDefinitionModel instances that define the node-level behavior of this flow definition.
  - `edges` (array<NodeEdgeModel>): List of NodeEdgeModel instances that encode control flow between nodes in this definition.
- `trigger_ids` (array<string>): List of TriggerModel identifiers that can start or resume this flow definition.
- `default_trigger_id` (string): Identifier of the TriggerModel that should be used as the default entry point for this flow.
- `primary_agent_profile_id` (string): Identifier of the main AgentProfileModel that provides default AI behavior for this flow.
- `agent_profile_ids` (array<string>): Optional list of AgentProfileModel identifiers that may participate in this flow when executed as a multi-agent orchestration.
- `supports_concurrent_instances` (boolean): Indicates whether multiple instances of this flow can run in parallel for the same business context.
- `max_concurrent_instances` (integer): Optional upper bound on the number of concurrent instances allowed for this flow definition.
- `default_timeout_ms` (integer): Optional default execution timeout in milliseconds applied to flow instances if no per-node timeout is set.
- `default_retry_policy` (object): Optional default retry policy applied at the flow level, providing baseline behavior for node retries when specific nodes do not override it. Typically includes max attempts and backoff strategy.
- `editor_state` (object): Optional persisted editor state such as canvas position, zoom level and node coordinates that allows the visual builder to restore the last layout used by the designer.
- `latest_version_id` (string): Identifier of the latest FlowVersionModel compiled from this definition, if any.
- `version_counter` (integer): Monotonic counter used to generate sequential FlowVersionModel versions from this definition.
- `compiler_hints` (object): Optional compiler hints and optimization flags that influence how this definition is translated into FlowVersionModel instances, such as preferred worker pools or execution strategies.
- `execution_state` (object): Operational gate that controls whether the flow accepts new executions, broken down by execution mode (test, prod). When `paused: true` for a given mode, all dispatch entrypoints (webhook, chain, scheduled, manual) skip orchestrator execution. In test mode, no FlowInstance is created (423 Locked). In prod mode, a FlowInstance with status `paused` is created for audit, and the orchestrator is NOT invoked.
  - `test` (object)
    - `paused` (boolean)
    - `paused_at` (string)
    - `paused_by` (string)
    - `paused_reason` (string)
  - `prod` (object)
    - `paused` (boolean)
    - `paused_at` (string)
    - `paused_by` (string)
    - `paused_reason` (string)
- `output_config` (array<object>): Configuration that defines which node outputs should be surfaced as the meaningful result when viewing workflow run outcomes. Each entry pins a specific node and controls what data (output, metrics, meta) is extracted and displayed.
  - `node_id` (string): Identifier of the node whose output should be included in the configured result.
  - `label` (string): Human-readable label for this output entry shown in the result view.
  - `display` (string): Display mode — "full" for entire output or "fields" for specific field selection.
  - `fields` (array<string>): When display is "fields", the list of output field names to extract.
  - `include_metrics` (boolean): Whether to include execution metrics (latency, token usage) for this node.
  - `include_meta` (boolean): Whether to include the meta object (evaluation details, routing decisions).
  - `order` (integer): Display order in the result view (lower values first).
- `git_binding` (object): Link with the Git repository this resource is synchronized from (see docs/concepts/git_sync.md): { repository_id, repository, branch, environment, package_path, resource_key, file_path,
  last_synced_commit, last_synced_at, deployed_commit, deployed_at, deployed_version, unlinked,
  unlinked_at }. unlinked = true means this installation stops syncing the resource from Git.
- `persistence_store_id` (string): Optional reference to a Payload Store (WorkflowOrchestrationMemoryStore) that defines where heavy execution payloads of this workflow are externalized. When set, string values above the store's thresholds are uploaded to the referenced blob storage (content-addressed by SHA-256) and replaced in execution documents by a `$payloadRef` descriptor. When null or absent, heavy values are truncated to an ephemeral preview (`_truncated` marker) — the workflow runs without any storage dependency.

### Responses

- `200`: OK.
- `500`: Something was wrong while you make this action.

### Example request

```bash
curl -X PATCH "https://api.sommatic.ai/workflow-orchestration/control-plane/flow-design/flow-definition/" \
  -H "Authorization: Bearer $SOMMATIC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
       "name": "<name>",
       "slug": "<slug>",
       "organization_id": "<organization_id>",
       "project_id": "<project_id>"
     }'
```

## Delete a flow definition by its id.

`DELETE /workflow-orchestration/control-plane/flow-design/flow-definition/`

Deletes a flow definition based on the provided ID.

Authentication: Bearer token

### Request body

ID of the flow definition to delete

- `id` (string)

### Responses

- `200`: OK.
- `500`: Something went wrong while performing this action.

### Example request

```bash
curl -X DELETE "https://api.sommatic.ai/workflow-orchestration/control-plane/flow-design/flow-definition/" \
  -H "Authorization: Bearer $SOMMATIC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
       "id": "<id>"
     }'
```

## Pause workflow execution for a given mode (test or prod).

`POST /workflow-orchestration/control-plane/flow-design/flow-definition/{id}/pause`

Operational gate that blocks new executions of the workflow for the chosen mode. In test mode, no FlowInstance is created (423 Locked). In prod mode, a FlowInstance with status `paused` is created for audit. SSE clients connected to the flow_definition receive a `workflow-paused` event.

Authentication: Bearer token

### Parameters

- `id` (path, string, required)

### Request body

- `mode` (string):  Allowed values: `test`, `prod`.
- `reason` (string)
- `actor` (string): user_id of the operator initiating the pause

### Responses


### Example request

```bash
curl -X POST "https://api.sommatic.ai/workflow-orchestration/control-plane/flow-design/flow-definition/<id>/pause" \
  -H "Authorization: Bearer $SOMMATIC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
       "mode": "test",
       "reason": "<reason>",
       "actor": "<actor>"
     }'
```

## Publish the current draft as a new version.

`POST /workflow-orchestration/control-plane/flow-design/flow-definition/{id}/publish`

Creates the next FlowVersion from draft_nodes / draft_edges with is_default = true, clears the previous default and updates latest_version_id / version_counter. Used by the studio Deploy action and by git sync.

Authentication: Bearer token

### Parameters

- `id` (path, string, required)

### Request body

- `description` (string)
- `git` (object): Origin when published from git: { repository, branch, commit, path, key }

### Responses

- `200`: The created version.

### Example request

```bash
curl -X POST "https://api.sommatic.ai/workflow-orchestration/control-plane/flow-design/flow-definition/<id>/publish" \
  -H "Authorization: Bearer $SOMMATIC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
       "description": "<description>",
       "git": {}
     }'
```

## Resume workflow execution for a given mode (test or prod).

`POST /workflow-orchestration/control-plane/flow-design/flow-definition/{id}/resume`

Clears the paused flag for the chosen mode; new dispatches proceed normally.

Authentication: Bearer token

### Parameters

- `id` (path, string, required)

### Request body

- `mode` (string):  Allowed values: `test`, `prod`.
- `actor` (string): user_id of the operator initiating the resume

### Responses


### Example request

```bash
curl -X POST "https://api.sommatic.ai/workflow-orchestration/control-plane/flow-design/flow-definition/<id>/resume" \
  -H "Authorization: Bearer $SOMMATIC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
       "mode": "test",
       "actor": "<actor>"
     }'
```

## Get an flow definition by query selector.

`GET /workflow-orchestration/control-plane/flow-design/flow-definition/{queryselector}`

Returns the flow definition information that matches the query selector an search specified in the route.

Authentication: Bearer token

### Parameters

- `queryselector` (path, enum, required): Is the filter available for this query Allowed values: `id`, `organization-id`, `all`, `statuses`.
- `search` (query, string): Keyword to search for entities.
- `include_status` (query, string): Optional status parameter to include flow definitions of a specific status.
- `exclude_status` (query, string): Optional status parameter to exclude flow definitions of a specific status.
- `page` (query, integer): Page number, starting at 1 (default 1).
- `pageSize` (query, integer): Records per page (default 25).

### Responses

- `200`: OK.
- `500`: Something was wrong while you make this action.

### Example request

```bash
curl -X GET "https://api.sommatic.ai/workflow-orchestration/control-plane/flow-design/flow-definition/<queryselector>" \
  -H "Authorization: Bearer $SOMMATIC_TOKEN"
```

## Get operators by query selector.

`GET /workflow-orchestration/control-plane/operator-registry/operator/{queryselector}`

Returns operator data matching the query selector. Use 'catalog' to fetch the live catalog from the orchestrator enriched with per-tenant entitlements. Use 'catalog-slug' to fetch a single operator by slug. Use 'entitlements' to list entitlements for an organization.

Authentication: Bearer token

### Parameters

- `queryselector` (path, enum, required): Filter for this query Allowed values: `id`, `organization-id`, `all`, `statuses`, `catalog`, `catalog-slug`, `entitlements`.
- `search` (query, string): Keyword to search for entities.
- `organization_id` (query, string): Organization ID for entitlement enrichment (used with catalog, catalog-slug, entitlements).
- `version` (query, string): Semantic version to resolve (used with catalog-slug). Defaults to latest.
- `include_status` (query, string): Optional status parameter to include templates of a specific status.
- `exclude_status` (query, string): Optional status parameter to exclude templates of a specific status.

### Responses

- `200`: OK.
- `500`: Something was wrong while you make this action.

### Example request

```bash
curl -X GET "https://api.sommatic.ai/workflow-orchestration/control-plane/operator-registry/operator/<queryselector>" \
  -H "Authorization: Bearer $SOMMATIC_TOKEN"
```

## Create a new trigger.

`POST /workflow-orchestration/control-plane/trigger-configuration/trigger/`

Returns the created Trigger with data provided.

Authentication: Bearer token

### Request body

Trigger object to be created.

- `organization_id` (string, required): Identifier of the OrganizationModel this trigger is associated with.
- `slug` (string, required): Stable semantic key uniquely identifying this trigger in the catalog (e.g. trigger:webhook.incoming).
- `name` (string, required): Human-readable name used in editors and documentation.
- `type` (string, required): Type of the trigger such as "webhook", "schedule", "message", "manual" or "external".
- `description` (string): Detailed description of the external event source and when this trigger should be used.
- `target_flow_definition_id` (string): Identifier of the FlowDefinitionModel this trigger is associated with, if the target is a definition.
- `target_flow_version_id` (string): Identifier of the FlowVersionModel this trigger activates directly, if the target is a specific version.
- `payload_mapping` (object): Optional mapping rules that transform external input (HTTP body, message payload, cron metadata) into the internal envelope structure used by Sommatic AI.
- `security` (object): Optional security rules describing required authentication, allowed origins, key verification or tenancy constraints for inbound events.
- `webhook` (object): Configuration block used when the trigger type is "webhook".
  - `method` (string): HTTP method to accept (GET, POST, etc.).
  - `path` (string): HTTP path for ingress routing.
  - `require_signature` (boolean): Whether the request must include a signature header.
  - `allowed_origins` (array<string>): Optional list of allowed origins for request validation.
- `schedule` (object): Configuration block used when the trigger type is "schedule".
  - `cron` (string): Cron expression driving periodic activation.
  - `timezone` (string): Timezone used when interpreting the cron expression.
- `message` (object): Configuration block for message-based triggers (queue, topic, event bus).
  - `channel` (string): Name of the message queue, topic or subscription to listen to.
  - `decode` (string): Optional codec or format used to decode the inbound message (json, protobuf, base64, etc.).
- `manual` (object): Configuration for manual triggers launched by a user or a system administrator.
  - `allowed_roles` (array<string>): Optional list of user roles allowed to invoke this trigger.
- `external` (object): Configuration block for external system triggers such as CRM, ERP, IoT or identity events.
  - `source_system` (string): Name of the external system emitting the event.
  - `event_type` (string): Type of event consumed from the external system.
- `default_instance_context` (object): Optional default context object that will be attached to all instances launched via this trigger.
- `tags` (array<string>): Optional list of free-form tags used for grouping, discovery and analytics.
- `is_enabled` (boolean): Indicates whether this trigger is active and able to start or resume flows.
- `is_system` (boolean): Indicates whether this trigger is a built-in system trigger rather than user-defined.
- `is_deprecated` (boolean): Indicates whether this trigger is deprecated and should be avoided in new designs.

### Responses

- `200`: OK.
- `500`: Something was wrong while you make this action.

### Example request

```bash
curl -X POST "https://api.sommatic.ai/workflow-orchestration/control-plane/trigger-configuration/trigger/" \
  -H "Authorization: Bearer $SOMMATIC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
       "organization_id": "<organization_id>",
       "slug": "<slug>",
       "name": "<name>",
       "type": "<type>"
     }'
```

## Update an existing trigger.

`PATCH /workflow-orchestration/control-plane/trigger-configuration/trigger/`

Updates the data of an existing Trigger with the data provided.

Authentication: Bearer token

### Request body

Trigger object to be created.

- `organization_id` (string, required): Identifier of the OrganizationModel this trigger is associated with.
- `slug` (string, required): Stable semantic key uniquely identifying this trigger in the catalog (e.g. trigger:webhook.incoming).
- `name` (string, required): Human-readable name used in editors and documentation.
- `type` (string, required): Type of the trigger such as "webhook", "schedule", "message", "manual" or "external".
- `description` (string): Detailed description of the external event source and when this trigger should be used.
- `target_flow_definition_id` (string): Identifier of the FlowDefinitionModel this trigger is associated with, if the target is a definition.
- `target_flow_version_id` (string): Identifier of the FlowVersionModel this trigger activates directly, if the target is a specific version.
- `payload_mapping` (object): Optional mapping rules that transform external input (HTTP body, message payload, cron metadata) into the internal envelope structure used by Sommatic AI.
- `security` (object): Optional security rules describing required authentication, allowed origins, key verification or tenancy constraints for inbound events.
- `webhook` (object): Configuration block used when the trigger type is "webhook".
  - `method` (string): HTTP method to accept (GET, POST, etc.).
  - `path` (string): HTTP path for ingress routing.
  - `require_signature` (boolean): Whether the request must include a signature header.
  - `allowed_origins` (array<string>): Optional list of allowed origins for request validation.
- `schedule` (object): Configuration block used when the trigger type is "schedule".
  - `cron` (string): Cron expression driving periodic activation.
  - `timezone` (string): Timezone used when interpreting the cron expression.
- `message` (object): Configuration block for message-based triggers (queue, topic, event bus).
  - `channel` (string): Name of the message queue, topic or subscription to listen to.
  - `decode` (string): Optional codec or format used to decode the inbound message (json, protobuf, base64, etc.).
- `manual` (object): Configuration for manual triggers launched by a user or a system administrator.
  - `allowed_roles` (array<string>): Optional list of user roles allowed to invoke this trigger.
- `external` (object): Configuration block for external system triggers such as CRM, ERP, IoT or identity events.
  - `source_system` (string): Name of the external system emitting the event.
  - `event_type` (string): Type of event consumed from the external system.
- `default_instance_context` (object): Optional default context object that will be attached to all instances launched via this trigger.
- `tags` (array<string>): Optional list of free-form tags used for grouping, discovery and analytics.
- `is_enabled` (boolean): Indicates whether this trigger is active and able to start or resume flows.
- `is_system` (boolean): Indicates whether this trigger is a built-in system trigger rather than user-defined.
- `is_deprecated` (boolean): Indicates whether this trigger is deprecated and should be avoided in new designs.

### Responses

- `200`: OK.
- `500`: Something was wrong while you make this action.

### Example request

```bash
curl -X PATCH "https://api.sommatic.ai/workflow-orchestration/control-plane/trigger-configuration/trigger/" \
  -H "Authorization: Bearer $SOMMATIC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
       "organization_id": "<organization_id>",
       "slug": "<slug>",
       "name": "<name>",
       "type": "<type>"
     }'
```

## Delete a Trigger by its id.

`DELETE /workflow-orchestration/control-plane/trigger-configuration/trigger/`

Deletes a Trigger based on the provided ID.

Authentication: Bearer token

### Request body

ID of the Trigger to delete

- `id` (string)

### Responses

- `200`: OK.
- `500`: Something went wrong while performing this action.

### Example request

```bash
curl -X DELETE "https://api.sommatic.ai/workflow-orchestration/control-plane/trigger-configuration/trigger/" \
  -H "Authorization: Bearer $SOMMATIC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
       "id": "<id>"
     }'
```

## Get an Trigger by query selector.

`GET /workflow-orchestration/control-plane/trigger-configuration/trigger/{queryselector}`

Returns the Trigger information that matches the query selector an search specified in the route.

Authentication: Bearer token

### Parameters

- `queryselector` (path, enum, required): Is the filter available for this query Allowed values: `id`, `organization-id`, `all`.
- `search` (query, string): Keyword to search for entities.
- `include_status` (query, string): Optional status parameter to include triggers of a specific status.
- `exclude_status` (query, string): Optional status parameter to exclude triggers of a specific status.
- `page` (query, integer): Page number, starting at 1 (default 1).
- `pageSize` (query, integer): Records per page (default 25).

### Responses

- `200`: OK.
- `500`: Something was wrong while you make this action.

### Example request

```bash
curl -X GET "https://api.sommatic.ai/workflow-orchestration/control-plane/trigger-configuration/trigger/<queryselector>" \
  -H "Authorization: Bearer $SOMMATIC_TOKEN"
```

## Create a new deployment.

`POST /workflow-orchestration/lifecycle/deployment/`

Returns the created Deployment with data provided.

Authentication: Bearer token

### Request body

Deployment object to be created.

- `organization_id` (string, required): Identifier of the OrganizationModel where this flow version is deployed.
- `flow_version_id` (string, required): Identifier of the FlowVersionModel being deployed.
- `flow_slug` (string, required): Stable flow key used to group deployments of the same logical flow across versions and environments.
- `environment_id` (string, required): Identifier of the EnvironmentModel where this flow version is deployed.
- `environment_key` (string, required): Semantic environment key such as "dev", "staging", "prod-eu", used for routing and configuration.
- `deployment_status` (string, required): Current deployment lifecycle state: "pending", "rolling_out", "active", "paused", "failed", "decommissioned".
- `rollout_strategy` (string): Rollout strategy applied to this deployment: "immediate", "canary", "blue-green", "shadow", or "manual".
- `is_active` (boolean): Indicates whether this deployment is currently eligible to receive traffic in its environment.
- `is_default` (boolean): True if this deployment is considered the default version for new instances of this flow in the environment.
- `traffic_percentage` (integer): Optional percentage of traffic routed to this deployment when using canary or multi-version strategies. For immediate or single-version rollouts this is typically 100.
- `shadow_mode` (boolean): When true, this deployment receives mirrored traffic for observation only; its results do not affect the primary flow outcome.
- `created_from_deployment_id` (string): Optional reference to a prior DeploymentModel when this deployment was created as a promotion, clone or blue-green counterpart of another deployment.
- `deployed_at` (integer): Unix timestamp when the deployment record was first created.
- `activated_at` (integer): Unix timestamp when the deployment first became active for live traffic.
- `deactivated_at` (integer): Unix timestamp when the deployment was deactivated or fully decommissioned.
- `notes` (string): Optional free-form notes about this deployment, such as change summary or rollout rationale.

### Responses

- `200`: OK.
- `500`: Something was wrong while you make this action.

### Example request

```bash
curl -X POST "https://api.sommatic.ai/workflow-orchestration/lifecycle/deployment/" \
  -H "Authorization: Bearer $SOMMATIC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
       "organization_id": "<organization_id>",
       "flow_version_id": "<flow_version_id>",
       "flow_slug": "<flow_slug>",
       "environment_id": "<environment_id>",
       "environment_key": "<environment_key>",
       "deployment_status": "<deployment_status>"
     }'
```

## Get an Deployment by query selector.

`GET /workflow-orchestration/lifecycle/deployment/{queryselector}`

Returns the Deployment information that matches the query selector an search specified in the route.

Authentication: Bearer token

### Parameters

- `queryselector` (path, enum, required): Is the filter available for this query Allowed values: `id`, `organization-id`, `all`.
- `search` (query, string): Keyword to search for entities.
- `include_status` (query, string): Optional status parameter to include deployments of a specific status.
- `exclude_status` (query, string): Optional status parameter to exclude deployments of a specific status.
- `page` (query, integer): Page number, starting at 1 (default 1).
- `pageSize` (query, integer): Records per page (default 25).

### Responses

- `200`: OK.
- `500`: Something was wrong while you make this action.

### Example request

```bash
curl -X GET "https://api.sommatic.ai/workflow-orchestration/lifecycle/deployment/<queryselector>" \
  -H "Authorization: Bearer $SOMMATIC_TOKEN"
```
