Heliont Contract Provider icon

Heliont Contract Provider

Provide the global contract object (read-only)

Overview

This node, named "Heliont Contract Provider," is designed to provide a global contract object in a read-only manner within an n8n workflow. It is particularly useful when you need to access or simulate a contract object that is shared globally across the workflow execution context.

A common scenario for this node is during development or testing phases where no real contract data is available in memory. In such cases, the node allows users to manually input a JSON-formatted test contract to simulate the presence of a contract. This helps in validating downstream nodes or logic that depend on contract data without requiring actual contract creation or retrieval.

For example, if you have a workflow that processes contract information and you want to test it without connecting to a live contract source, you can use this node to inject a mock contract JSON. When running in normal (non-manual) mode, the node expects a contract object to be present in the workflow's global static data; otherwise, it throws an error.

Properties

Name Meaning
Test Contract (JSON) A JSON object used only in manual/editor mode to simulate a contract when no real contract exists in memory. It accepts any valid JSON structure representing a contract.

Output

The node produces two outputs:

  1. First output: An array of items where each item's json field contains the input data with the contract-related parts stripped out. This is done by applying a utility function that removes contract-specific details from the input JSON.

  2. Second output: A single item containing the current global contract object under the json.contract field. This represents the contract data either retrieved from the workflow's global static memory or the simulated test contract provided via the node's property.

No binary data is output by this node.

Dependencies

  • The node relies on a utility function (stripContract) imported from a local module to clean contract data from input JSON.
  • It requires the workflow to maintain a global static data object containing the contract under a specific key. If this is not present and the node is not in manual mode, it will throw an error.
  • No external API keys or services are required.
  • The node supports manual mode operation in the n8n editor, allowing simulation of contract data.

Troubleshooting

  • Error: "No contract found in memory. Please create a contract before providing it."
    This occurs if the node runs outside manual mode and no contract object is found in the workflow's global static data. To resolve this, ensure that a contract has been created and stored in the global static data before executing this node.

  • Error: "Invalid JSON in Test Contract field"
    This happens if the JSON entered in the "Test Contract (JSON)" property is malformed. Verify that the JSON syntax is correct and properly formatted.

  • If the node outputs unexpected results, verify that the input data does not contain contract information that should be stripped, as the node applies a cleaning function to remove contract details from inputs.

Links and References

Discussion