Rahsaz Initializer icon

Rahsaz Initializer

RahsazInitializer Methods

Overview

This node, named "Rahsaz Initializer," is designed to initialize and synchronize data between two database tables based on a specified source system. It supports filtering input data and selecting specific output fields. The node queries a PostgreSQL database to find matching records in a linking table that associates IDs from two different systems ("Click" and "PayamGostar"). Based on the query results and the presence of deletion markers, it routes data into one of three outputs: insert, update, or delete.

Common scenarios for this node include:

  • Synchronizing records between two external systems by mapping their IDs.
  • Filtering incoming data before processing to reduce unnecessary operations.
  • Selecting only relevant fields to pass downstream for further processing.

Practical example:

  • You have user data coming from a "Click" system and want to map it to corresponding entries in a "PayamGostar" system. This node helps identify whether the record should be inserted, updated, or deleted in the destination system based on the current state in the database.

Properties

Name Meaning
Source Select the source system of the data. Options: "Click", "PayamGostar".
Source Table Name of the source table from which data originates (string).
Destination Table Name of the destination table where data will be synchronized (string).
Filter data? Boolean flag to enable or disable filtering of input data before processing.
Filters Conditions to filter input data when filtering is enabled. Supports case sensitivity and type validation options.
Filter Options Collection of options for filtering behavior:
- Ignore Case: Whether to ignore letter case in conditions.
- Less Strict Type Validation: Whether to allow loose type casting during comparisons.
Output Fields Comma-separated list of field names to return from the source payload. Optional.

Output

The node has three outputs named "INSERT", "UPDATE", and "DELETE":

  • INSERT: Contains items representing new records to be inserted into the destination system.
  • UPDATE: Contains items representing existing records that need to be updated.
  • DELETE: Contains items representing records marked as deleted and should be removed from the destination system.

Each output item’s JSON structure includes:

  • source: The selected source system name.
  • ID: The ID from the source system.
  • _ID_: The mapped ID from the other system.
  • TABLE: The source table name.
  • _TABLE_: The destination table name.
  • Additional fields as specified in the "Output Fields" property, extracted from the input payload.

If binary data were involved, it would be summarized here, but this node does not handle binary data.

Dependencies

  • Requires a PostgreSQL database connection configured via credentials.
  • Uses a helper function to initialize the PostgreSQL client.
  • Relies on a linking table (public.ck_pg) in the database that maps IDs between the two source systems.
  • No external API keys or services beyond the PostgreSQL database are required.

Troubleshooting

  • Empty outputs: If no data passes through any output, verify that the input data matches the filters (if enabled) and that the linking table contains the expected mappings.
  • Filter errors: Errors thrown during filter evaluation may suggest type mismatches. Enabling "Less Strict Type Validation" can help resolve these issues.
  • Database connection failures: Ensure PostgreSQL credentials are correctly set up and the database is accessible.
  • Query issues: Check that the source and destination table names correspond to valid entries in the linking table and that the ID fields exist.

Links and References

Discussion