Stubmation
Run Stub Action per row from Sheet
Runs an action on a stub for each row in a given spreadsheet
This stubmation workflow enables the user to run a stub action for each line that appears in a spreadsheet.
A scenario for this could be:
- You have a list of customers, their names and cell numbers in a spreadsheet.
- You would like to create a stub for each customer that will send them a WhatsApp and start a conversation
This stubmation will enable you to upload the CSV file and do that.
What Happens behind the scenes
The stubmation will collect the file with fileuuid
, read it's contents and each line becomes a record for it to process. It will use the data from the line and run the stub action via webhook, as defined in trigger_stubaction
, with the line's data injected into object defined in inject_data_object
.
In our example below, the action create_stub_via_webhook
action will be run on stubref ~~stub.stubref
. The create_stub_via_webhook
action has been defined in the template to use the incoming data and run the Create Stub
task to create the new stub.
It will then pause for the duration as defined in delay_per_row_seconds
, before it moves to the next line's data to run the stub action.
When all lines are processed, it will automatically stop.
Run Stub Action per row from Sheet
Flow Data Explained
required string
fileuuid The stubber file system UUID of the spreadsheet file (xls/csv) that contains the data to be used to run the stub action
optional string
delay_per_row_seconds Default: 5
This is the time in seconds the workflow will pause between triggering the stub action for each row of data.
required json object
trigger_stubaction Contains all the details of the action that needs to be triggered. These action are triggered via webhook, so the action needs to be Webhook enabled. If the action's webhook has authentication enabled, the authentication should be correct for the action being called.
required string
trigger_stubaction.stubref The stubref for the stub the action needs to run on.
required string
trigger_stubaction.action_name The name of the webhook enabled action that the stubmation workflow needs trigger.
optional string
trigger_stubaction.inject_data_object Default: row_data
The name of the json object the row data will be injected into at stubpost.data.payload
. eg.
optional json object
trigger_stubaction.authorization Contains Webhook authorization data, should the action's webhook the stubmation workflow is to call, require authorization
optional string
trigger_stubaction.authorization.type The type of authorization the actions's webhook is configured for.
optional json object
trigger_stubaction.authorization.keys Contains the keys used to authorize the webhook call
optional string
trigger_stubaction.authorization.keys.token The token used in Bearer type authorization
Duplicate Detection
This will allow you to specify column names who's contents will be hashed and stored.
When the process runs, it check if the hash exists in the hash store.
- If the hash does exist, it simply does not run the action on the stub and discards the job.
- If the hash does not exist, it creates and stores the hash and then runs the action.
Flow Data Explained
Showing the additional parameters required for duplicate detection.
required json object
trigger_stubaction.duplicate_detection Contains the keys used for duplicate detection
required boolean
trigger_stubaction.duplicate_detection.enable Instructs the workflow to store duplicate detection data and to detect for duplicates.
required JSON Array
trigger_stubaction.duplicate_detection.columns_to_hash This is an array of the column names, who's combined contents, will be hashed and stored for duplicate detection.
The duplicate detection is only stored for 4 days. It is then automatically removed.
These names should as they appear in the csv.