Codeless Playbooks for Webhook Data Formatting
LAST UPDATED: DEC 20, 2024
Introduction
This article provides guidance on implementing webhook data formatting for codeless playbooks. With a webhook data formatter, users can efficiently operate on incoming data streams and ensure proper formatting prior to downstream processing. By following the outlined steps, the user will accomplish the following: 1) Transform webhook data by transmitting it through a demonstration codeless playbook and 2) Use the transformed webhook data within the Webhook Authentication section of an integration Fetch Event command.
Creating a New Utility Command
Create a codeless playbook utility command.
Click on the Configuration navigation link.
Click on the Utility Commands module.
Click on the + button next to the search field.
Set it up a a Code Playbook implementation.
Enter a Command Display Name.
Select the Codeless Playbook option under the Implementation label.
Click on the + Add button.
Making the Codeless Playbook Available
Click on the Edit button to enter mode.
Click on the initial codeless playbook node.
Scroll down, then tick the Event/Incident Data Formatter checkbox to make this codeless playbook available for use in the Using the Codeless Playbook as Data Formatter section.
Click on the button.
Click on the Submit button to transition this codeless playbook into mode.
Adding Sample Inputs and Outputs
The initial codeless playbook node includes the Inputs and Outputs tabs, where optional sample data can be provided to illustrate the expected data structure for both incoming playbook data and the final playbook output.
Click on the Edit button to return to mode.
Add an input parameter.
Click on the Inputs tab within the root node popup.
Click on the + New Input Parameter button to add data into this codeless playbook.
Input the relevant fields, then save the input.
Enter a parameter name, display name, parameter type, and sample data within the New Parameter popup.
Click on the Save button.
The user should now see an expanded accordion containing their sample data.
Add a return data for the initial playbook node.
Click on an Output tab.
Click on the Return Data category tab.
Click on the + Add Return Data button.
Enter the command’s return data type, then click on the Save button.
Click on the button.
Preprocessing the Data
Data preprocessing for the event pipeline is performed according to business requirements and can be accomplished through various methods, including the straightforward use of a data formatter.
Attach a Data Formatter task onto the initial playbook task node.
Input formatting logic to transform data, in Jinja syntax.
Preparing Preprocessed Data for Use
A Passdown task will be used to construct the return data for the codeless playbook, enabling it to be used in the Using the Codeless Playbook as Data Formatter section.
Attach a Passdown task onto the data formatter.
Click on the Passdown task node, then enter in your input parameters.
Destination Field: Choose the Return Data option for the case of a data formatter.
Destination JSON Path (Optional): Used to specify the top-level JSON key name for the data provided in the third parameter. For instance, to set the top-level key name as demo, enter $.demo.
Data: The value for the corresponding key specified in the second parameter (Destination JSON Path).
READER NOTE
Using a Passdown task in this manner is analogous to invoking the returnOutputModel() function in a Python utility command with only the resultData parameter passed.
Click on the Dynamic toggle for the Data input parameter, then click on the icon.
Select and save the data formatter’s returnData path.
Click on the button.
Click on the Submit button to transition this codeless playbook into mode.
Using the Codeless Playbook as Data Formatter
Click on the Configuration navigation link, then click on the Integrations module.
Look up an integration command, then click on the Fetch Event (or Fetch Incident) command.
Toggle on Webhook Authentication, then click on a webhook authentication option (API Key or JWT).
Click into an Event Ingestion key, then click on the Additional Settings accordion.
Select the codeless playbook utility command under the Data Formatter dropdown.