- Worked Example
- Prerequisites
- Creating a Workflow from a Managed Template
- Adding and Configuring a Webhook Trigger
Worked Example
If your operational use case for ingesting customer usage data into the m3ter platform calls for a file upload from data files stored in an AWS S3 bucket, you can utilize the Submit measurements from S3 source with SNS Trigger Workflow managed template designed to meet this requirement:- Uses an Incoming Webhook trigger that exploits the AWS Simple Notification Service (SNS) - a Workflow run is triggered when a file is uploaded to the designated AWS S3 bucket.
- When triggered, the Workflow reads the file’s content, applies transformations on the usage data, and ingests the data into the m3ter platform via the m3ter File Upload service.
Prerequisites
To complete the configuration and setup for a usage data ingest Workflow based on the Submit measurements from S3 source with SNS Trigger Workflow managed template, you’ll need to perform some prerequisite work:Setting Up Credentials
you must first create required Credentials in your m3ter Organization:Creating Incoming Webhook Credential for AWS SNS Request
In the m3ter Console, open the Settings>Integrations page and select the Credentials tab. From there you can create an AWS SNS Request Incoming Webhook Credential:- Enter a Name for the Credential and for Destination, select m3sh Workflow.
- For Type select AWS SNS request.
- For Topic arn, enter the relevant Amazon Resource Name in the standard format including
regionandaccount-id. For example:
arn:aws:sns:eu-west-2:441235399388:m3sh-measurements
- Select Create credential. The new Incoming Webhook Credential is listed on the Integrations page under Credentials:

- When we add a trigger to the example Workflow for usage data ingest, this Incoming Webhook Credential will be available for selection, allowing the AWS SNS service to access our Workflow as destination and act as its trigger.
Creating AWS Service Credential
In the m3ter Console, open the Settings>Integrations page and select the Credentials tab. From there you can create an AWS Service Credential:- Enter a Name for the Credential and for Destination, select AWS.
- For Account id, enter your AWS account number that hosts the IAM role m3ter will assume when connecting with AWS.
- For Role name, enter the IAM role m3ter will assume.
- Select Create credential. The new AWS Service Credential is listed on the Integrations page under Credentials:

- When we create the example Workflow for usage data ingest, this AWS Service Credential will be available for selection to configure the AWS Read from S3 function used as the second step in the Workflow and allowing it to access the S3 bucket.
Checking Usage Data Files
The m3ter platform’s File Upload service API for usage data measurements accepts JSON formatted files as the default. However, constraints are imposed on file structure and ingest will fail if these constraints are not met. For details, please review the File Upload Service API topic and ensure the usage data measurements files in your AWS S3 buckets for file upload by the Workflow comply with these requirements.CSV Usage Data Files. CSV formatted usage data files are also supported.
Creating a Workflow from a Managed Template
For the current worked example, from the Workflows page we can quickly create a Workflow from a managed template to implement usage data ingest using file upload from an S3 bucket. To create a m3sh Workflow from a managed template:- Select m3sh:

- The Workflows page opens.
- Select Create workflow>Create managed workflow:

- The Workflows>Create from template page opens:

- Enter the details of the new Workflow:
- Name. (Required)
- Code. (Required)
- Description. (Required)
- Workflow template. (Required) Use the drop-down to select the PLATFORM TEMPLATE you want to base the new Workflow on: Submit measurements fro S3 source with SNS trigger.
- Select Create. The new Workflow opens in the builder in Draft mode and is clearly flagged as MANAGED:

- If you zoom in, you will see that the second step uses an AWS Read from S3 function:

- Note that this function is flagged as invalid because configuration is incomplete.
- Select to open the function’s Edit panel:

- Enter the missing required details to complete the AWS Read from S3 function’s configuration:
- Credentials. Select the AWS Service Credential created above under Prerequisites.
- Region.
- Bucket.

- To complete setting up the Workflow, we must now add a webhook trigger to the usage data ingest Workflow - see the following section.
CSV Usage Data Files. CSV formatted usage data files are also supported for upload and is an option available when you edit the Read from S3 function for the Workflow.
Adding and Configuring a Webhook Trigger
When you add a webhook trigger to a Workflow, you have the option to select users in your Organization that you want to receive an email notification when the trigger is disabled. To add and configure a Workflow Webhook trigger:- Select m3sh. The Workflows page opens.
- Select the Name hotlink text of the Workflow you want to add a trigger to. The Workflow opens in Draft mode.
- Select Workflow triggers. In the current worked example, no triggers have yet been added for the Workflow:

- Select Add trigger>Add webhook trigger:

- An Add webhook trigger dialog appears:

- Enter a Name for the webhook trigger.
- Use the Credentials drop-down to select the Incoming Webhook Credential you want to use to authenticate with the Workflow. For the current worked example, we’ve selected the Incoming Webhook Credential we set up above - see Creating Incoming Webhook Credential for AWS SNS Request.
- Select Submit. The selected webhook trigger is listed under Workflow triggers:
- For the selected INCOMING WEBHOOK, you can check:
- The URL and copy it to your clipboard.
- Whether the webhook is ACTIVE or INACTIVE.
- If you want to set up users in you Organization to receive an email notification if the trigger is disabled, select the Details icon:

- A Workflow trigger modal appears:
- Under Trigger options, use the Disabled notification users drop-down to add the Organization users you want to receive an email notification if the Workflow trigger is disabled.
Disabled Webhook Triggers: Webhook triggers are automatically disabled if the Workflow encounters errors in 20 consecutive runs via a trigger.
- Select Update. A message shows to confirm that the Trigger options for notifying Organization users were updated successfully.
- Select Publish draft. The Workflow is now ready to be triggered and run when you upload usage data files into the designated S3 bucket.
Branching from a Managed Template
When you create a Workflow, you select a managed template as the starting point to branch your Workflow from. No editing restrictions are imposed and you’ll be able to add new functions, remove functions, or modify functions. However, your Workflow will no longer benefit from updates made for future versions of the original platform managed template. To create a m3sh Workflow from a managed template:- Select m3sh:

- The Workflows page opens.
- Select Create workflow>Branch from template:

- A Branch from template modal opens:

- Under PLATFORM TEMPLATES, select the Workflow template you want to branch your new Workflow from. The selected template is loaded into the modal to preview it:

- You can zoom in and inspect function details to assess the suitability of the template as a starting point for your new Workflow:

- Select the Branch from this template hotlink. The Workflows>Create page open allowing you to enter required details for the new Workflow:
- Name.
- Code.
- Description.
- Select Create. The Workflow opens in the Builder in Draft mode:

- You can select to open the Functions menu or add Global parameters.
- The Workflow is not flagged as MANAGED.