Overview
This node, named "Heliont Contract Generator," is designed to create and output a global contract object within an n8n workflow. It accepts a JSON representation of a contract as input, validates and stores it in the workflow's static data for global accessibility, and outputs both the processed input items and the stored contract object.
Common scenarios where this node is beneficial include:
- Initializing or updating a shared contract configuration that other nodes in the workflow can reference.
- Centralizing contract data management in workflows dealing with messaging hubs or similar systems requiring a global contract definition.
- Preparing and validating contract data before passing it downstream for further processing or integration.
Practical example:
- A user pastes a contract JSON into the node’s input field. The node parses and stores this contract globally. Subsequent nodes can then access this contract from the workflow static data to perform operations like message validation or routing based on the contract.
Properties
| Name | Meaning |
|---|---|
| Contract (JSON) | Paste or drag a JSON object representing the contract to initialize the global contract. |
Output
The node produces two outputs:
First output: An array of items corresponding to the input items, but with their
jsonproperty processed by removing certain contract-specific details (via a utility function). This represents the cleaned or stripped version of each input item.Second output: A single item containing the global contract object under the
json.contractfield. This reflects the contract parsed from the input property and stored in the workflow's static data.
No binary data output is produced by this node.
Dependencies
- The node depends on a utility function (
stripContract) imported from a local module to process input items by stripping contract-related information. - No external API keys or services are required.
- The node uses the workflow's static data storage to maintain the global contract object.
Troubleshooting
- Invalid JSON error: If the "Contract (JSON)" property contains invalid JSON text, the node will throw an error stating "Invalid JSON provided in Contract (JSON) field." To resolve this, ensure the JSON is well-formed before pasting or uploading.
- Empty or missing contract: If the provided JSON does not contain a
contractproperty, the entire JSON object is stored as the contract. Users should verify that the contract structure matches expected formats for downstream usage. - Unexpected output structure: Since the first output strips contract details from input items, if users expect unmodified input data, they should be aware of this transformation.
Links and References
- No external links are referenced in the source code.
- For JSON validation, consider using online JSON validators or editors before inputting contract data.