Skip to main content

workflows

Creates, updates, deletes, gets or lists a workflows resource.

Overview

Nameworkflows
TypeResource
Iddatadog.software_delivery.workflows

Fields

The following fields are returned by SELECT queries:

Successfully got a workflow.

NameDatatypeDescription
idstringThe workflow identifier
attributesobjectThe definition of WorkflowDataAttributes object.
relationshipsobjectThe definition of WorkflowDataRelationships object.
typestringThe definition of WorkflowDataType object. (workflows) (example: workflows)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_workflowselectworkflow_idGet a workflow by ID. This API requires a [registered application key](https:​//docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). Alternatively, you can configure these permissions [in the UI](https:​//docs.datadoghq.com/account_management/api-app-keys/#actions-api-access).
list_workflowsselectlimit, page, sort, filter[query], filter[trigger_ids], filter[include_unpublished], filter[include_specs]List all workflows in your organization. This API requires a [registered application key](https:​//docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). Alternatively, you can configure these permissions [in the UI](https:​//docs.datadoghq.com/account_management/api-app-keys/#actions-api-access).
create_workflowinsertdataCreate a new workflow, returning the workflow ID. This API requires a [registered application key](https:​//docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). Alternatively, you can configure these permissions [in the UI](https:​//docs.datadoghq.com/account_management/api-app-keys/#actions-api-access).
update_workflowupdateworkflow_id, dataUpdate a workflow by ID. This API requires a [registered application key](https:​//docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). Alternatively, you can configure these permissions [in the UI](https:​//docs.datadoghq.com/account_management/api-app-keys/#actions-api-access).
delete_workflowdeleteworkflow_idDelete a workflow by ID. This API requires a [registered application key](https:​//docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). Alternatively, you can configure these permissions [in the UI](https:​//docs.datadoghq.com/account_management/api-app-keys/#actions-api-access).

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
sitestringThe Datadog site (region) for your organization, for example datadoghq.com, us3.datadoghq.com, us5.datadoghq.com, ap1.datadoghq.com, ap2.datadoghq.com, datadoghq.eu, ddog-gov.com. Resolved from the DD_SITE environment variable when set. Optional: defaults to datadoghq.com, or the value of the DD_SITE environment variable when set; a WHERE value overrides both.
workflow_idstringThe ID of the workflow.
filter[include_specs]booleanWhether to include the full spec of each workflow in the response. When false (the default), each workflow's spec is returned as null. (wire: filter[includeSpecs])
filter[include_unpublished]booleanWhether to include unpublished workflows in the response. (wire: filter[includeUnpublished])
filter[query]stringA search query used to filter the returned workflows. The query performs a case-insensitive substring match against each workflow's name, creator name, and handle. If the query contains a colon (for example, team:infra), the query is treated as a key:value tag filter. (example: deploy)
filter[trigger_ids]arrayFilters the returned workflows by one or more trigger types, such as monitor, schedule, or githubWebhook. To specify the multiple types, repeat this parameter. (example: [monitor]) (wire: filter[triggerIds])
limitinteger (int64)The maximum number of workflows to return per page. (example: 50)
pageinteger (int64)The page number to return, starting from 0. (example: 0)
sortstringThe sort order for the returned workflows. Provide a comma-separated list of fields, each optionally prefixed with - for descending order. Supported fields are name, createdAt, updatedAt, creatorName, ownerName, and lastExecutedAt. (example: -updatedAt)

SELECT examples

Get a workflow by ID. This API requires a registered application key. Alternatively, you can configure these permissions in the UI.

SELECT
id,
attributes,
relationships,
type
FROM datadog.software_delivery.workflows
WHERE workflow_id = '{{ workflow_id }}' -- required
;

INSERT examples

Create a new workflow, returning the workflow ID. This API requires a registered application key. Alternatively, you can configure these permissions in the UI.

INSERT INTO datadog.software_delivery.workflows (
data
)
SELECT
'{{ data }}' /* required */
RETURNING
data
;

UPDATE examples

Update a workflow by ID. This API requires a registered application key. Alternatively, you can configure these permissions in the UI.

UPDATE datadog.software_delivery.workflows
SET
data = '{{ data }}'
WHERE
workflow_id = '{{ workflow_id }}' --required
AND data = '{{ data }}' --required
RETURNING
data;

DELETE examples

Delete a workflow by ID. This API requires a registered application key. Alternatively, you can configure these permissions in the UI.

DELETE FROM datadog.software_delivery.workflows
WHERE workflow_id = '{{ workflow_id }}' --required
;