Download OpenAPI specification:
This is API specification of the M2A Workflows API
Workflows handle the orchestration of live stream resources of a scheduled event.
Workflows use Templates to define how a workflow will be executed. A Template specifies the resources, configuration desired states and order that resources are to be utilized.
You can create many workflow instances from 1 workflow template. The macros in the workflow templates will allow you to have different configuration per workflow instance:
Currently, only programmatic access via the API endpoints is available. The API requests and responses use the JSON:API specification https://jsonapi.org/.
A workflow instance represents a collection of media processing resources and their configuration that needs to be managed to achieve the video processing objectives.
Workflow instance is enrolled to an M2A scheduled event, and the system will update a workflow instance when completing a workflow for an event.
Gets a workflow instance by ID
| instance-id required | string <uuid> (Resource identifier) Example: c49c499b-4e7e-4acb-ae83-f528b6ed194d The id of the workflow instance to retrieve |
| owner required | string <uuid> (Resource identifier) Example: owner=c49c499b-4e7e-4acb-ae83-f528b6ed194d The id of the target account |
| fields[instance] | string Example: fields[instance]=metadata Return only a subset of the instances data attributes. Attributes is a comma delimited list of strings. Valid fields are:
|
| Accept | string (JSON API) Value: "application/vnd.api+json" Content type (expressed as MIME types) the client is able to understand. |
| Content-Type | string (JSON API) Value: "application/vnd.api+json" The original media type of the resource. |
{- "data": {
- "attributes": {
- "state": "STARTING",
- "id": "00000000-0000-0000-0000-000000000005",
- "event-handlers": [
- {
- "events": [
- "PRE-TX"
], - "sequence": [
- {
- "nodes": [
- {
- "desired-state": "RUNNING",
- "id": "00000000-1000-0000-0000-000000000000",
- "internal-state": "IDLE",
- "name": "MediaPackage1",
- "node-id": "00000000-1000-0000-0000-000000000001"
}, - {
- "desired-state": "RUNNING",
- "id": "00000000-2000-0000-0000-000000000000",
- "internal-state": "IDLE",
- "name": "MediaLiveEncoder1",
- "node-id": "00000000-2000-0000-0000-000000000001"
}
]
}
]
}, - {
- "events": [
- "POST-TX"
], - "sequence": [
- {
- "nodes": [
- {
- "desired-state": "STOPPED",
- "id": "00000000-1000-0000-0000-000000000001",
- "internal-state": "IDLE",
- "name": "MediaLiveEncoder1",
- "node-id": "00000000-2000-0000-0000-000000000001"
}, - {
- "desired-state": "STOPPED",
- "id": "00000000-1000-0000-0000-000000000000",
- "internal-state": "IDLE",
- "name": "MediaPackage1",
- "node-id": "00000000-1000-0000-0000-000000000001"
}
]
}
]
}
], - "metadata": {
- "created": "2023-07-03T14:24:25.164293+00:00",
- "labels": [ ],
- "updated": "2023-07-03T14:24:25.164308+00:00"
}, - "nodes": [
- {
- "id": "00000000-1000-0000-0000-000000000001",
- "input-values": {
- "name": "MediaPackage1",
- "template-configuration": {
- "reference-id": "WF Test",
- "values": { }
}
}, - "name": "MediaPackage1",
- "node-type": "packager"
}, - {
- "id": "00000000-2000-0000-0000-000000000001",
- "input-values": {
- "name": "{{ nodes.Encoder-Node-1.name }}",
- "medialive-input-role-arn": "arn:aws:iam::168760559311:role/MediaLiveAccessRole",
- "region": "eu-west-1",
- "settings": {
- "template-name": "my-template",
- "template-configuration": { },
- "destinations": [
- {
- "output-group-type": "MEDIA_PACKAGE",
- "packager-id": "{{ nodes.MediaPackage1.packager-id }}"
}
], - "inputs": [
- {
- "type": "MEDIACONNECT"
}
]
}
}, - "name": "Encoder-Node-1",
- "node-type": "encoder_v4"
}
], - "signals-received": [ ],
}, - "id": "00000000-0000-0000-0000-000000000003",
- "links": {
- "self": "/api/workflows/v1/instances/b73d68e2-8995-4bbb-9e8f-2eb329916db4"
}, - "relationships": {
- "template": {
- "data": {
- "type": "workflow-template",
- "id": "PAL"
}
}, - "owner": {
- "data": {
- "id": "5e4fb584-f094-426e-be90-4c74dd1dbb40",
- "type": "target-account"
}
}
}, - "type": "workflow-instance"
}
}Create a Workflow Instance that will track the state of a workflow execution. If the specified Workflow Template requires input parameters, these will have to be supplied in the request. Note that in order to execute the workflow, the instance will need to be associated with a Schedule Event after the instance has been created.
| fields[instance] | string Example: fields[instance]=metadata Return only a subset of the instances data attributes. Attributes is a comma delimited list of strings. Valid fields are:
|
| Accept | string (JSON API) Value: "application/vnd.api+json" Content type (expressed as MIME types) the client is able to understand. |
| Content-Type | string (JSON API) Value: "application/vnd.api+json" The original media type of the resource. |
The workflow instance payload
required | object |
{- "data": {
- "type": "workflow-instance",
- "attributes": {
- "config": {
- "m2a:name": "test"
}
}, - "relationships": {
- "owner": {
- "data": {
- "id": "00000000-0000-0000-0000-000000000001",
- "type": "target-account"
}
}, - "template": {
- "data": {
- "type": "workflow-template",
- "id": "PAL"
}
}
}
}
}{- "data": {
- "attributes": {
- "state": "STARTING",
- "id": "00000000-0000-0000-0000-000000000005",
- "event-handlers": [
- {
- "events": [
- "PRE-TX"
], - "sequence": [
- {
- "nodes": [
- {
- "desired-state": "RUNNING",
- "id": "00000000-1000-0000-0000-000000000000",
- "internal-state": "IDLE",
- "name": "MediaPackage1",
- "node-id": "00000000-1000-0000-0000-000000000001"
}, - {
- "desired-state": "RUNNING",
- "id": "00000000-2000-0000-0000-000000000000",
- "internal-state": "IDLE",
- "name": "MediaLiveEncoder1",
- "node-id": "00000000-2000-0000-0000-000000000001"
}
]
}
]
}, - {
- "events": [
- "POST-TX"
], - "sequence": [
- {
- "nodes": [
- {
- "desired-state": "STOPPED",
- "id": "00000000-1000-0000-0000-000000000001",
- "internal-state": "IDLE",
- "name": "MediaLiveEncoder1",
- "node-id": "00000000-2000-0000-0000-000000000001"
}, - {
- "desired-state": "STOPPED",
- "id": "00000000-1000-0000-0000-000000000000",
- "internal-state": "IDLE",
- "name": "MediaPackage1",
- "node-id": "00000000-1000-0000-0000-000000000001"
}
]
}
]
}
], - "metadata": {
- "created": "2023-07-03T14:24:25.164293+00:00",
- "labels": [ ],
- "updated": "2023-07-03T14:24:25.164308+00:00"
}, - "nodes": [
- {
- "id": "00000000-1000-0000-0000-000000000001",
- "input-values": {
- "name": "MediaPackage1",
- "template-configuration": {
- "reference-id": "WF Test",
- "values": { }
}
}, - "name": "MediaPackage1",
- "node-type": "packager"
}, - {
- "id": "00000000-2000-0000-0000-000000000001",
- "input-values": {
- "name": "{{ nodes.Encoder-Node-1.name }}",
- "medialive-input-role-arn": "arn:aws:iam::168760559311:role/MediaLiveAccessRole",
- "region": "eu-west-1",
- "settings": {
- "template-name": "my-template",
- "template-configuration": { },
- "destinations": [
- {
- "output-group-type": "MEDIA_PACKAGE",
- "packager-id": "{{ nodes.MediaPackage1.packager-id }}"
}
], - "inputs": [
- {
- "type": "MEDIACONNECT"
}
]
}
}, - "name": "Encoder-Node-1",
- "node-type": "encoder_v4"
}
], - "signals-received": [ ],
}, - "id": "00000000-0000-0000-0000-000000000003",
- "links": {
- "self": "/api/workflows/v1/instances/b73d68e2-8995-4bbb-9e8f-2eb329916db4"
}, - "relationships": {
- "template": {
- "data": {
- "type": "workflow-template",
- "id": "PAL"
}
}, - "owner": {
- "data": {
- "id": "5e4fb584-f094-426e-be90-4c74dd1dbb40",
- "type": "target-account"
}
}
}, - "type": "workflow-instance"
}
}M2A sends HTTP POST notifications to a URL of your choice as each
sequence step executes. Configure a webhook on a Workflow Template
by setting workflow-settings.webhook.
M2A sends this notification to the webhook URL configured on a
Workflow Template each time a sequence step starts, succeeds, or
fails. Three calls are made per node: one for
workflow-sequence-start, one for workflow-sequence-success or
workflow-sequence-failed.
Your endpoint must return 2xx. 5xx responses are retried up to
3 times with exponential backoff (1 s, 2 s, 4 s). 4xx responses
are not retried.
| organisation-id required | string <uuid> (Organisation ID) UUID of the organisation that owns this workflow. |
| target-account-id required | string <uuid> (Target account ID) UUID of the target account the workflow is running under. |
| event-id required | string <uuid> (Schedule event ID) UUID of the M2A schedule event this workflow instance is enrolled to. |
| workflow-instance-id required | string <uuid> (Workflow instance ID) UUID of the workflow instance that triggered this notification. |
| event required | string (Schedule event) The broadcast lifecycle event that triggered this sequence (e.g. PRE-TX, TX, POST-TX). |
| node-name required | string (Node name) The |
| sequence-node-id required | string <uuid> (Sequence node ID) UUID of the sequence node (step) within the event-handler. |
| action-type required | string (Action type) Enum: "workflow-sequence-start" "workflow-sequence-success" "workflow-sequence-failed" Indicates the outcome of the sequence step:
|
| timestamp required | integer (Timestamp) Unix epoch timestamp in milliseconds when the webhook message was dispatched. |
{- "organisation-id": "65337911-49f4-4e1a-b32c-ee351bfb0c27",
- "target-account-id": "b1155af6-b8f3-46a7-af3c-3e4e372ba81b",
- "event-id": "bcb1988f-1cb2-48bd-9ee6-26f7f53dfa4c",
- "workflow-instance-id": "5113b398-4095-4ee7-8b2d-969afe8a472c",
- "event": "PRE-TX",
- "node-name": "Primary-Encoder",
- "sequence-node-id": "e8f12e33-5eb5-43ba-8253-57b673f0fe8b",
- "action-type": "workflow-sequence-start",
- "timestamp": 1664882060713
}Internal use only
Defines the resources and the video flows between them to fulfil a customer’s live video workflow.
A Workflow Template is a reusable blueprint. You create many Workflow Instances from one Template. The Template declares nodes — each node represents a media resource (encoder, packager, connect source, etc.) — and event-handlers that describe what should happen at each point in the broadcast lifecycle (e.g. PRE-TX, ON-AIR, POST-TX).
Any string value in a Template can include a macro using double-brace
syntax: {{ variable_name }}. Macros are resolved immediately at
instance creation time, using the config dictionary supplied in the
Instance POST payload. Once the instance is created, all macro values
are fixed.
Example — parameterising the encoder region:
Template node:
{
"name": "Primary-Encoder",
"node-type": "encoder_v4",
"input-values": {
"region": "{{ region }}",
"medialive-input-role-arn": "{{ medialive_arn }}"
}
}
Instance POST payload:
{
"data": {
"attributes": {
"config": {
"region": "eu-west-1",
"medialive_arn": "arn:aws:iam::123456789:role/MediaLiveRole"
}
}
}
}
Every occurrence of {{ region }} is replaced with "eu-west-1" and
{{ medialive_arn }} with the supplied ARN at the moment the instance
is created. This lets a single Template serve many events across
different regions or accounts.
Some fields require a JSON array rather than a plain string (for example
subnet-ids and security-group-ids on private-network encoder inputs).
The standard {{ variable }} macro always produces a string. When you
need a macro to expand into a list, use m2a.expand:
{{m2a.expand(variable_name)}}
Like standard macros, m2a.expand is rendered immediately at instance
creation time.
Example:
Template:
{
"subnet-ids": "{{m2a.expand(subnet_ids)}}",
"security-group-ids": "{{m2a.expand(security_group_ids)}}"
}
Instance config:
{
"subnet_ids": ["subnet-aaa", "subnet-bbb"],
"security_group_ids": ["sg-111", "sg-222"]
}
{{m2a.expand(subnet_ids)}} is replaced with the full list
["subnet-aaa", "subnet-bbb"] rather than a string representation of
it, at the moment the instance is created.
Each node in a Template is identified by its name field, which must be
unique within the Template. To wire one node’s output into another
node’s input, use the nodes.<NodeName>.<field> macro syntax:
{{ nodes.NodeName.field }}
Unlike standard macros, node references are not resolved at instance creation time. They are resolved at event time, once the referenced node has actually run and produced its output. This means the encoder will always receive the live, real values from the packager — even though those values did not exist when the instance was created.
Example — encoder referencing a packager’s output:
{
"nodes": [
{
"name": "MediaPackage1",
"node-type": "packager",
"input-values": { ... }
},
{
"name": "Primary-Encoder",
"node-type": "encoder_v4",
"input-values": {
"settings": {
"destinations": [
{
"output-group-type": "MEDIA_PACKAGE",
"packager-id": "{{ nodes.MediaPackage1.packager-id }}"
}
]
}
}
}
]
}
When the event fires, MediaPackage1 runs first. Once it is up,
{{ nodes.MediaPackage1.packager-id }} resolves to the live packager ID
and the encoder is started with the correct destination.
Event-handlers contain sequences that control the order in which nodes
are started and stopped. Each step in a sequence references a node by
its name using the node-name field. The name field on the sequence
step itself is a human-readable label for the step. Neither name nor
node-name may be a macro — both must be static strings.
Example — sequence step that starts the encoder on PRE-TX:
{
"nodes": [
{
"name": "Primary-Encoder",
"node-type": "encoder_v4",
"input-values": { ... }
}
],
"event-handlers": [
{
"events": ["PRE-TX"],
"sequence": [
{
"nodes": [
{
"name": "Start primary encoder",
"node-name": "Primary-Encoder",
"desired-state": "RUNNING"
}
]
}
]
}
]
}
node-name must match the name of an existing node in the Template
exactly. Because node names are the sole identifier within a Template,
they must be unique — duplicate names are not permitted.
POST a workflow template
| Accept | string (JSON API) Value: "application/vnd.api+json" Content type (expressed as MIME types) the client is able to understand. |
| Content-Type | string (JSON API) Value: "application/vnd.api+json" The original media type of the resource. |
The template payload
required | object |
{- "data": {
- "type": "workflow-template",
- "attributes": {
- "resource-name": "Live_Sport_Template",
- "state": "active",
- "metadata": {
- "labels": [
- {
- "key": "m2amedia.tv:name",
- "value": "{{ event_name }}"
}
]
}, - "nodes": [
- {
- "name": "Primary-Connect-Source",
- "node-type": "connect_source",
- "input-values": {
- "source-id": "{{ connect_source_id }}"
}
}, - {
- "name": "Primary-Packager",
- "node-type": "packager",
- "input-values": {
- "name": "{{ packager_name }}",
- "template-configuration": {
- "reference-id": "{{ packager_template_reference }}",
- "values": { }
}
}
}, - {
- "name": "Primary-Encoder",
- "node-type": "encoder_v4",
- "input-values": {
- "name": "{{ encoder_name }}",
- "medialive-input-role-arn": "{{ medialive_arn }}",
- "region": "{{ region }}",
- "settings": {
- "template-name": "{{ encoder_template_name }}",
- "template-configuration": { },
- "destinations": [
- {
- "output-group-type": "MEDIA_PACKAGE",
- "packager-id": "{{ nodes.Primary-Packager.packager-id }}"
}
], - "inputs": [
- {
- "type": "MEDIACONNECT"
}
]
}
}
}, - {
- "name": "Primary-Endpoint-Discovery",
- "node-type": "endpoint_discovery",
- "input-values": {
- "labels-source": "scheduled.event",
- "endpoint-name": "HLS-HI-RES",
- "metadata": {
- "labels": [ ]
}
}
}, - {
- "name": "Primary-CDI-Output",
- "node-type": "connect_output",
- "input-values": {
- "destination-name": "CDI-Primary",
- "encoder-node-id": "{{ nodes.Primary-Encoder.encoder-id }}",
- "source-id": "{{ nodes.Primary-Connect-Source.source-id }}",
- "address-durability": "ephemeral",
- "vpc-interface-name": "{{ vpc_interface_name }}",
- "region": "{{ region }}",
- "metadata": {
- "labels": [ ]
}
}
}, - {
- "name": "Primary-URL-Rewrite",
- "node-type": "url_rewrite",
- "input-values": {
- "cache-instance-id": "{{ cache_instance_id }}",
- "event-id": "{{ event_id }}",
- "rewrite-rules-configuration-name": "{{ rewrite_rules_config }}"
}
}, - {
- "name": "Schedule-Notifications",
- "node-type": "schedule_event_resource_defined_notifications",
- "input-values": {
- "signals": [
- {
- "event-time-attribute-name": "on-air-start-time",
- "delta-seconds": -300,
- "name": "START-SLATE"
}, - {
- "event-time-attribute-name": "on-air-end-time",
- "delta-seconds": 0,
- "name": "END-SLATE"
}
]
}
}, - {
- "name": "Primary-Harvest-Job",
- "node-type": "harvest_job",
- "input-values": {
- "destination": {
- "bucket-arn": "arn:aws:s3:::{{ harvest_bucket_name }}",
- "bucket-region": "{{ region }}"
}, - "source-url": "{{ nodes.Primary-Endpoint-Discovery.url }}"
}
}, - {
- "name": "Primary-Export",
- "node-type": "export",
- "input-values": {
- "destination": {
- "bucket": "arn:aws:s3:::my-export-bucket",
- "prefix": "exports/my-event"
}, - "capture-id": "4ca2f09e-c485-4062-be10-91ecee1b4797",
- "discontinuity-handling": "accept-and-export",
- "start": "on-air-start-time",
- "end": "on-air-end-time",
- "role": "{{ export_role_arn }}"
}
}, - {
- "name": "Primary-YouTube",
- "node-type": "youtube_broadcast",
- "input-values": {
- "channel-name": "{{ youtube_channel_name }}",
- "mode": "primary",
- "youtube-access-token-secret-arn": "{{ youtube_secret_arn }}"
}
}, - {
- "name": "Primary-Compute",
- "node-type": "compute_resource",
- "input-values": {
- "name": "{{ compute_name }}",
- "desired-capacity": "1",
- "resource-type": "asg",
- "configuration-name": "{{ compute_config_name }}",
- "metadata": {
- "labels": [ ]
}, - "service-settings": {
- "service-type": "ffmpeg-relay",
}
}
}, - {
- "name": "Primary-Signal",
- "node-type": "signals",
- "input-values": {
- "playlist": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
- "metadata": {
- "labels": [ ]
}
}
}
], - "input-parameters": [
- {
- "key-name": "connect_source_id",
- "description": "Connect source to use for this event",
- "parameter-type": "dynamic",
- "dynamic-data-source": "event_connect_sources"
}, - {
- "key-name": "encoder_template_name",
- "description": "MediaLive channel template to use",
- "parameter-type": "enum",
- "choices": [
- {
- "stored-value": "hd-1080i-50",
- "display-value": "HD 1080i 50Hz"
}, - {
- "stored-value": "hd-720p-50",
- "display-value": "HD 720p 50Hz"
}
]
}, - {
- "key-name": "bitrate_kbps",
- "description": "Target output bitrate in kbps",
- "parameter-type": "integer",
- "min-value": 1000,
- "max-value": 20000,
- "default": {
- "value": 8000
}
}, - {
- "key-name": "region",
- "description": "AWS region where resources will be deployed",
- "parameter-type": "string",
- "default": {
- "value": "eu-west-1"
}
}
], - "event-handlers": [
- {
- "events": [
- "PRE-TX"
], - "sequence": [
- {
- "nodes": [
- {
- "name": "Start connect source",
- "node-name": "Primary-Connect-Source",
- "desired-state": "RUNNING"
}
]
}, - {
- "nodes": [
- {
- "name": "Start packager",
- "node-name": "Primary-Packager",
- "desired-state": "RUNNING"
}
]
}, - {
- "nodes": [
- {
- "name": "Start encoder",
- "node-name": "Primary-Encoder",
- "desired-state": "RUNNING"
}, - {
- "name": "Start URL rewrite",
- "node-name": "Primary-URL-Rewrite",
- "desired-state": "RUNNING"
}
]
}
]
}, - {
- "events": [
- "TX"
], - "sequence": [
- {
- "nodes": [
- {
- "name": "Start YouTube broadcast",
- "node-name": "Primary-YouTube",
- "desired-state": "RUNNING"
}
]
}
]
}, - {
- "events": [
- "POST-TX"
], - "sequence": [
- {
- "nodes": [
- {
- "name": "Stop encoder",
- "node-name": "Primary-Encoder",
- "desired-state": "IDLE"
}
]
}, - {
- "nodes": [
- {
- "name": "Stop packager",
- "node-name": "Primary-Packager",
- "desired-state": "IDLE"
}, - {
- "name": "Start harvest job",
- "node-name": "Primary-Harvest-Job",
- "desired-state": "RUNNING"
}
]
}
]
}, - {
- "events": [
- "ENDED"
], - "sequence": [
- {
- "nodes": [
- {
- "name": "Stop connect source",
- "node-name": "Primary-Connect-Source",
- "desired-state": "IDLE"
}
]
}
]
}
], - "workflow-settings": {
- "webhook": {
- "url": "{{ webhook_url }}",
- "sequence-events": "all"
}
}
}, - "relationships": {
- "owner": {
- "data": {
- "id": "fafd9559-7686-4fb9-b828-6d360859da7b",
- "type": "target-account"
}
}
}
}
}{- "data": {
- "id": "c49c499b-4e7e-4acb-ae83-f528b6ed194d",
- "type": "workflow-template",
- "attributes": {
- "metadata": {
- "labels": [
- {
- "key": "m2amedia.tv:name",
- "value": "NTSC"
}
], - "created": "2022-11-03T14:00:00+00:00",
- "updated": "2022-11-03T15:00:00+00:00"
}, - "resource-name": "string",
- "state": "active",
- "nodes": [
- {
- "id": "string",
- "name": "Primary-Encoder",
- "webhook-enabled": true,
- "input-values": {
- "source-id": "{{nodes.SomeOtherNode.id}}"
}, - "node-type": "connect_source",
- "state": "IDLE"
}
], - "event-handlers": [
- {
- "events": [
- "DRAFT"
], - "sequence": [
- {
- "nodes": [
- {
- "id": "string",
- "node-id": "66475cb1-da95-4ce9-ba31-3bcc330e7bb9",
- "node-name": "string",
- "name": "Start primary encoder",
- "desired-state": "ACTIVE",
- "internal-state": "ACTIVE",
- "progress-token": "string",
- "node-state": "IDLE",
- "error": {
- "code": null,
- "message": null
}, - "step-function-execution-arn": "string",
- "exec-start": 0,
- "exec-end": 0
}
]
}
]
}
], - "input-parameters": [
- {
- "key-name": "Incoming Media Framerate",
- "display-name": "string",
- "description": "string",
- "parameter-type": "dynamic",
- "dynamic-data-source": "all_connect_sources",
- "default": {
- "label-match": "string"
}, - "validation-required": true
}
], - "ui-layout": "string",
- "workflow-settings": {
- "webhook": {
- "url": "{{webhook-url}}",
- "sequence-events": "all"
}
}
}, - "relationships": {
- "owner": {
- "data": {
- "id": "c49c499b-4e7e-4acb-ae83-f528b6ed194d",
- "type": "target-account"
}
}
}, - "links": {
- "self": "/api/workflows/v1/templates/c49c499b-4e7e-4acb-ae83-f528b6ed194d"
}
}
}Gets a list of workflow templates for a target account. The workflow template list is paginated.
Each page contains up to 50 templates.
The following structure is used for the response where data contains
a list of event objects and next contains an url of the next page of
events:
{
'data': [ ... ],
'links': {
'next': ...
}
}
| owner required | string <uuid> (Resource identifier) Example: owner=c49c499b-4e7e-4acb-ae83-f528b6ed194d The id of the target account |
| fields[template] | string Example: fields[template]=metadata Return only a subset of the template's data attributes. Attributes is a comma delimited list of strings. Valid fields are:
|
| Accept | string (JSON API) Value: "application/vnd.api+json" Content type (expressed as MIME types) the client is able to understand. |
| Content-Type | string (JSON API) Value: "application/vnd.api+json" The original media type of the resource. |
{- "links": {
- "next": "/api/workflows/v1/templates/?next=eyJwayI6IHsiUyI6ICIwOThjNzM0NC05N jQ5LTQyYWUtYTA5Ny0xMzJjN2ZiYWZjNTMjYTM3OWIzYmYtNGFmMi00ZThkLWE4N mEtZGY0MjRmNGY3YmUwIn0sICJzayI6IHsiUyI6ICJvd25lciMwOThjNzM0NC05N jQ5LTQyYWUtYTA5Ny0xMzJjN2ZiYWZjNTMifSwgImVuZF90aW1lIjogeyJTIjogI jIwMjItMDktMTNUMTg6MTQ6MTUuMzMwNDUzKzAwMDAifX0%3D&owner=098c7344 -9649-42ae-a097-132c7fbafc53"
}, - "data": [
- {
- "id": "fafd9559-7686-4fb9-b828-6d360859da7b",
- "type": "workflow-template",
- "attributes": {
- "resource-name": "Example_Template_1",
- "state": "active",
- "metadata": {
- "labels": [
- {
- "key": "m2amedia.tv:name",
- "value": "{{meta.labels.0.value}}"
}
]
}, - "nodes": [
- {
- "id": "f2e56a74-a6db-4b02-800c-a729ddb36795",
- "name": "{{ node_name }}",
- "node-type": "encoder_v4",
- "input-values": {
- "name": "My encoder",
- "medialive-input-role-arn": "{{ medialive_arn }}",
- "region": "{{ region }}",
- "settings": {
- "template-name": "my-template",
- "template-configuration": { },
- "destinations": [
- {
- "output-group-type": "MEDIA_PACKAGE",
- "channel-id": "channel-id-test"
}
], - "inputs": [
- {
- "type": "MEDIACONNECT"
}
]
}
}
}, - {
- "id": "f2e56a74-a6db-4b02-800c-a729ddb36794",
- "name": "packager node name",
- "node-type": "packager",
- "input-values": {
- "name": "{{ packager_name }}",
- "template-configuration": {
- "reference-id": "{{ packager_template_reference }}",
- "values": { }
}
}
}, - {
- "id": "f2e56a74-a6db-4b02-800c-a729ddb36733",
- "name": "connect source node name",
- "node-type": "connect_source",
- "input-values": {
- "source-id": "{{primary-source}}"
}
}
], - "event-handlers": [
- {
- "events": [
- "PRE-TX"
], - "sequence": [
- {
- "nodes": [
- {
- "desired-state": "RUNNING",
- "id": "ea8d5b8c-cf77-4653-b852-93f79cba21d8",
- "internal-state": "IDLE",
- "name": "{{ node_event_handler_1 }}",
- "node-id": "ea8d5b8c-cf77-4653-b852-93f79cba21d8"
}
]
}
]
}
]
}, - "relationships": {
- "owner": {
- "data": {
- "id": "fafd9559-7686-4fb9-b828-6d360859da7b",
- "type": "target-account"
}
}
}
}
]
}Retrieves a workflow template using Template ID.
| template-id required | string <uuid> (Resource identifier) Example: c49c499b-4e7e-4acb-ae83-f528b6ed194d The id of the workflow template id to retrieve |
| owner required | string <uuid> (Resource identifier) Example: owner=c49c499b-4e7e-4acb-ae83-f528b6ed194d The id of the target account |
| fields[template] | string Example: fields[template]=metadata Return only a subset of the template's data attributes. Attributes is a comma delimited list of strings. Valid fields are:
|
| Accept | string (JSON API) Value: "application/vnd.api+json" Content type (expressed as MIME types) the client is able to understand. |
| Content-Type | string (JSON API) Value: "application/vnd.api+json" The original media type of the resource. |
{- "data": {
- "id": "fafd9559-7686-4fb9-b828-6d360859da7b",
- "type": "workflow-template",
- "attributes": {
- "resource-name": "Example_Template_1",
- "state": "active",
- "metadata": {
- "labels": [
- {
- "key": "m2amedia.tv:name",
- "value": "{{meta.labels.0.value}}"
}
]
}, - "nodes": [
- {
- "id": "f2e56a74-a6db-4b02-800c-a729ddb36795",
- "name": "{{ node_name }}",
- "node-type": "encoder_v4",
- "input-values": {
- "name": "My encoder",
- "medialive-input-role-arn": "{{ medialive_arn }}",
- "region": "{{ region }}",
- "settings": {
- "template-name": "my-template",
- "template-configuration": { },
- "destinations": [
- {
- "output-group-type": "MEDIA_PACKAGE",
- "channel-id": "channel-id-test"
}
], - "inputs": [
- {
- "type": "MEDIACONNECT"
}
]
}
}
}, - {
- "id": "f2e56a74-a6db-4b02-800c-a729ddb36794",
- "name": "packager node name",
- "node-type": "packager",
- "input-values": {
- "name": "{{ packager_name }}",
- "template-configuration": {
- "reference-id": "{{ packager_template_reference }}",
- "values": { }
}
}
}, - {
- "id": "f2e56a74-a6db-4b02-800c-a729ddb36733",
- "name": "connect source node name",
- "node-type": "connect_source",
- "input-values": {
- "source-id": "{{primary-source}}"
}
}
], - "event-handlers": [
- {
- "events": [
- "PRE-TX"
], - "sequence": [
- {
- "nodes": [
- {
- "desired-state": "RUNNING",
- "id": "ea8d5b8c-cf77-4653-b852-93f79cba21d8",
- "internal-state": "IDLE",
- "name": "{{ node_event_handler_1 }}",
- "node-id": "ea8d5b8c-cf77-4653-b852-93f79cba21d8"
}
]
}
]
}
]
}, - "relationships": {
- "owner": {
- "data": {
- "id": "fafd9559-7686-4fb9-b828-6d360859da7b",
- "type": "target-account"
}
}
}
}
}Deletes a workflow template using Template ID.
| template-id required | string <uuid> (Resource identifier) Example: c49c499b-4e7e-4acb-ae83-f528b6ed194d The id of the workflow template id to retrieve |
| owner required | string <uuid> (Resource identifier) Example: owner=c49c499b-4e7e-4acb-ae83-f528b6ed194d The id of the target account |
| Accept | string (JSON API) Value: "application/vnd.api+json" Content type (expressed as MIME types) the client is able to understand. |
| Content-Type | string (JSON API) Value: "application/vnd.api+json" The original media type of the resource. |
{- "errors": [
- {
- "status": "400",
- "title": "Bad Request",
- "detail": "Missing parameter required: owner"
}
]
}Retrieves a workflow template using the specified resource-name.
| resource-name required | string <string> (Resource name) Example: my template The name of the workflow template |
| owner required | string <uuid> (Resource identifier) Example: owner=c49c499b-4e7e-4acb-ae83-f528b6ed194d The id of the target account |
| fields[template] | string Example: fields[template]=metadata Return only a subset of the template's data attributes. Attributes is a comma delimited list of strings. Valid fields are:
|
| Accept | string (JSON API) Value: "application/vnd.api+json" Content type (expressed as MIME types) the client is able to understand. |
| Content-Type | string (JSON API) Value: "application/vnd.api+json" The original media type of the resource. |
{- "data": {
- "id": "fafd9559-7686-4fb9-b828-6d360859da7b",
- "type": "workflow-template",
- "attributes": {
- "resource-name": "Example_Template_1",
- "state": "active",
- "metadata": {
- "labels": [
- {
- "key": "m2amedia.tv:name",
- "value": "{{meta.labels.0.value}}"
}
]
}, - "nodes": [
- {
- "id": "f2e56a74-a6db-4b02-800c-a729ddb36795",
- "name": "{{ node_name }}",
- "node-type": "encoder_v4",
- "input-values": {
- "name": "My encoder",
- "medialive-input-role-arn": "{{ medialive_arn }}",
- "region": "{{ region }}",
- "settings": {
- "template-name": "my-template",
- "template-configuration": { },
- "destinations": [
- {
- "output-group-type": "MEDIA_PACKAGE",
- "channel-id": "channel-id-test"
}
], - "inputs": [
- {
- "type": "MEDIACONNECT"
}
]
}
}
}, - {
- "id": "f2e56a74-a6db-4b02-800c-a729ddb36794",
- "name": "packager node name",
- "node-type": "packager",
- "input-values": {
- "name": "{{ packager_name }}",
- "template-configuration": {
- "reference-id": "{{ packager_template_reference }}",
- "values": { }
}
}
}, - {
- "id": "f2e56a74-a6db-4b02-800c-a729ddb36733",
- "name": "connect source node name",
- "node-type": "connect_source",
- "input-values": {
- "source-id": "{{primary-source}}"
}
}
], - "event-handlers": [
- {
- "events": [
- "PRE-TX"
], - "sequence": [
- {
- "nodes": [
- {
- "desired-state": "RUNNING",
- "id": "ea8d5b8c-cf77-4653-b852-93f79cba21d8",
- "internal-state": "IDLE",
- "name": "{{ node_event_handler_1 }}",
- "node-id": "ea8d5b8c-cf77-4653-b852-93f79cba21d8"
}
]
}
]
}
]
}, - "relationships": {
- "owner": {
- "data": {
- "id": "fafd9559-7686-4fb9-b828-6d360859da7b",
- "type": "target-account"
}
}
}
}
}Deletes a workflow template using the specified resource-name.
| resource-name required | string <string> (Resource name) Example: my template The name of the workflow template |
| owner required | string <uuid> (Resource identifier) Example: owner=c49c499b-4e7e-4acb-ae83-f528b6ed194d The id of the target account |
| Accept | string (JSON API) Value: "application/vnd.api+json" Content type (expressed as MIME types) the client is able to understand. |
| Content-Type | string (JSON API) Value: "application/vnd.api+json" The original media type of the resource. |
{- "errors": [
- {
- "status": "400",
- "title": "Bad Request",
- "detail": "Missing parameter required: owner"
}
]
}