flow_templates
Creates, updates, deletes, gets or lists a flow_templates resource.
Overview
| Name | flow_templates |
| Type | Resource |
| Id | aws.iotthingsgraph.flow_templates |
Fields
The following fields are returned by SELECT queries:
- get_flow_template
- search_flow_templates
| Name | Datatype | Description |
|---|---|---|
definition | object | A document that defines an entity. |
summary | object | An object that contains summary information about a workflow. |
validated_namespace_version | integer (int64) | The version of the user's namespace against which the workflow was validated. Use this value in your system instance. |
| Name | Datatype | Description |
|---|---|---|
id | string | The ID of the workflow. (pattern: <code>^urn:tdm:(([a-z]{2}-(gov-)?[a-z]{4,9}-[0-9]{1,3}/[0-9]+/)[\p{Alnum}]+(/[\p{Alnum}]+)):([\p{Alpha}]):([\p{Alnum}]+(/[\p{Alnum}]+))$</code>) |
arn | string | The ARN of the workflow. |
created_at | string (date-time) | The date when the workflow was created. |
revision_number | integer (int64) | The revision number of the workflow. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_flow_template | select | region | Gets the latest version of the DefinitionDocument and FlowTemplateSummary for the specified workflow. | |
search_flow_templates | select | region | Searches for summary information about workflows. | |
create_flow_template | insert | region, definition | Creates a workflow template. Workflows can be created only in the user's namespace. (The public namespace contains only entities.) The workflow can contain only entities in the specified namespace. The workflow is validated against the entities in the latest version of the user's namespace unless another namespace version is specified in the request. | |
update_flow_template | update | region, id, definition | Updates the specified workflow. All deployed systems and system instances that use the workflow will see the changes in the flow when it is redeployed. If you don't want this behavior, copy the workflow (creating a new workflow with a different ID), and update the copy. The workflow can contain only entities in the specified namespace. | |
delete_flow_template | delete | region | Deletes a workflow. Any new system or deployment that contains this workflow will fail to update or deploy. Existing deployments that contain the workflow will continue to run (since they use a snapshot of the workflow taken at the time of deployment). |
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.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- get_flow_template
- search_flow_templates
Gets the latest version of the DefinitionDocument and FlowTemplateSummary for the specified workflow.
SELECT
definition,
summary,
validated_namespace_version
FROM aws.iotthingsgraph.flow_templates
WHERE region = '{{ region }}' -- required
;
Searches for summary information about workflows.
SELECT
id,
arn,
created_at,
revision_number
FROM aws.iotthingsgraph.flow_templates
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_flow_template
- Manifest
Creates a workflow template. Workflows can be created only in the user's namespace. (The public namespace contains only entities.) The workflow can contain only entities in the specified namespace. The workflow is validated against the entities in the latest version of the user's namespace unless another namespace version is specified in the request.
INSERT INTO aws.iotthingsgraph.flow_templates (
definition,
compatibleNamespaceVersion,
region
)
SELECT
'{{ definition }}' /* required */,
{{ compatibleNamespaceVersion }},
'{{ region }}'
RETURNING
summary
;
# Description fields are for documentation purposes
- name: flow_templates
props:
- name: region
value: "{{ region }}"
description: Required parameter for the flow_templates resource.
- name: definition
description: |
The workflow DefinitionDocument.
value:
language: "{{ language }}"
text: "{{ text }}"
- name: compatibleNamespaceVersion
value: {{ compatibleNamespaceVersion }}
description: |
The namespace version in which the workflow is to be created. If no value is specified, the latest version is used by default.
UPDATE examples
- update_flow_template
Updates the specified workflow. All deployed systems and system instances that use the workflow will see the changes in the flow when it is redeployed. If you don't want this behavior, copy the workflow (creating a new workflow with a different ID), and update the copy. The workflow can contain only entities in the specified namespace.
UPDATE aws.iotthingsgraph.flow_templates
SET
id = '{{ id }}',
definition = '{{ definition }}',
compatibleNamespaceVersion = {{ compatibleNamespaceVersion }}
WHERE
region = '{{ region }}' --required
AND id = '{{ id }}' --required
AND definition = '{{ definition }}' --required
RETURNING
summary;
DELETE examples
- delete_flow_template
Deletes a workflow. Any new system or deployment that contains this workflow will fail to update or deploy. Existing deployments that contain the workflow will continue to run (since they use a snapshot of the workflow taken at the time of deployment).
DELETE FROM aws.iotthingsgraph.flow_templates
WHERE region = '{{ region }}' --required
;