1. Stubmation
  2. Run Stub Action per row from Sheet

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.

INFO

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

loading...

Flow Data Explained

fileuuid
required
string

The stubber file system UUID of the spreadsheet file (xls/csv) that contains the data to be used to run the stub action


delay_per_row_seconds
optional
string

Default: 5

This is the time in seconds the workflow will pause between triggering the stub action for each row of data.


trigger_stubaction
required
json object

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.


trigger_stubaction.stubref
required
string

The stubref for the stub the action needs to run on.


trigger_stubaction.action_name
required
string

The name of the webhook enabled action that the stubmation workflow needs trigger.


trigger_stubaction.inject_data_object
optional
string

Default: row_data
The name of the json object the row data will be injected into at stubpost.data.payload. eg.

loading...

trigger_stubaction.authorization
optional
json object

Contains Webhook authorization data, should the action's webhook the stubmation workflow is to call, require authorization


trigger_stubaction.authorization.type
optional
string

The type of authorization the actions's webhook is configured for.


trigger_stubaction.authorization.keys
optional
json object

Contains the keys used to authorize the webhook call


trigger_stubaction.authorization.keys.token
optional
string

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.
loading...

Flow Data Explained

Showing the additional parameters required for duplicate detection.


trigger_stubaction.duplicate_detection
required
json object

Contains the keys used for duplicate detection


trigger_stubaction.duplicate_detection.enable
required
boolean

Instructs the workflow to store duplicate detection data and to detect for duplicates.


trigger_stubaction.duplicate_detection.columns_to_hash
required
JSON Array

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.