Skip to main content

flow_templates

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

Overview

Nameflow_templates
TypeResource
Idaws.iotthingsgraph.flow_templates

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
definitionobjectA document that defines an entity.
summaryobjectAn object that contains summary information about a workflow.
validated_namespace_versioninteger (int64)The version of the user's namespace against which the workflow was validated. Use this value in your system instance.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_flow_templateselectregionGets the latest version of the DefinitionDocument and FlowTemplateSummary for the specified workflow.
search_flow_templatesselectregionSearches for summary information about workflows.
create_flow_templateinsertregion, definitionCreates 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_templateupdateregion, id, definitionUpdates 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_templatedeleteregionDeletes 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.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

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
;

INSERT examples

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
;

UPDATE examples

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

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
;