Output Webhooks

THIS PAGE
Introduction
Key Features
Configuring an Output Webhook
Example Configuration
Testing the Output Webhook
Best Practices

Introduction

Output Webhooks in Canonic are designed to transform and append data to your workflow's final result. Unlike Function Webhooks, which offer a broader scope for implementing custom logic, Output Webhooks focus on manipulating and structuring the output data.

Key Features

  • Data Transformation: Allows for the modification and organization of data before it's returned from the workflow.
  • Output Key Specification: Define a specific key under which the transformed data will be appended in the workflow's final output.

Configuring an Output Webhook

  1. Specify the Output Key: Determine the key under which the output data will be injected. This key will be used to access the transformed data in the final response.
  2. Transform Data: Implement the logic to transform or modify the data as required. This could involve data cleaning, formatting, or any other type of processing.
  3. Append to Output: The transformed data is automatically appended to the specified output key in the final workflow response.

Example Configuration

In a scenario where you need to clean up and format user data before sending it as a response:

  1. Output Key: 'formattedUserData'
  2. Transformation Logic: Implement code to format user names, dates, or any other relevant data.
  3. Final Output: The transformed user data will be appended under 'formattedUserData' in the workflow's final response.

Screenshot of the Function Node's code editor

Testing the Output Webhook

To ensure the Output Webhook functions as expected:

  1. Input Test Data: Provide relevant data that the webhook will process.
  2. Execute Workflow: Run the workflow to trigger the Output Webhook.
  3. Verify Output: Check if the data is correctly transformed and appended under the specified key in the response.

Best Practices

  • Clear Transformation Logic: Keep the data transformation logic clear and concise for maintainability.
  • Relevant Output Key: Choose an output key that clearly represents the transformed data.
  • Efficient Processing: Ensure the transformation process is efficient, especially when handling large datasets.

Note: Output Webhooks are an effective way to enhance the structure and quality of your workflow's output. Proper configuration and testing ensure the transformed data is accurate and appropriately appended to the final response.

Did you find what you were looking for?
👍
👎
What went wrong?
Need more help?We have a thriving Discordcommunity that can help you with all things Canonic. →