CalcsLive Calculator icon

CalcsLive Calculator

Execute unit-aware calculations using CalcsLive articles

Overview

This node executes unit-aware calculations using CalcsLive articles identified by an article ID. It allows users to input physical quantities with values and units, then performs the calculation defined in the specified CalcsLive article, returning the computed results.

Common scenarios include:

  • Engineering or physics workflows where calculations like speed, distance, time, force, etc., need to be automated.
  • Converting between units while performing domain-specific computations.
  • Integrating complex calculators into automation pipelines without manual intervention.

Practical example:

  • Using the Speed Distance Time Calculator article (ID: 3M5NVUCGW-3TA), you can input distance and time values, specify units, and get the calculated speed in a desired unit.

The node supports two configuration modes:

  • Enhanced: User-friendly interface with dropdowns for selecting input/output physical quantities and auto-discovery of defaults.
  • Legacy: Direct JSON input for advanced users who want full control over inputs and outputs.

Properties

Name Meaning
Article ID The CalcsLive article ID or short ID to use for the calculation. Example: 3M5NVUCGW-3TA (Speed Distance Time Calculator).
Configuration Mode Choose how to configure inputs and outputs:
- Enhanced: User-friendly interface with dropdowns and auto-discovery.
- Legacy: Direct JSON input for advanced users.
Inputs (Legacy mode) JSON object specifying input physical quantities with their values and units. Use symbols from the chosen calculation article. Example: { "D": { "value": 150, "unit": "km" }, "t": { "value": 2, "unit": "h" } }.
Outputs (Optional, Legacy mode) JSON object specifying desired output units keyed by symbol. Leave empty to get all outputs with default units. Example: { "s": { "unit": "mph[mile/h]" } }.
Input Physical Quantities (Enhanced mode) Collection of input physical quantities:
- Symbol Name or ID: Select from list or specify ID.
- Value: Numeric value (optional; uses default if empty).
- Unit: Unit string (optional; uses default if empty).
Output Physical Quantities (Enhanced mode) Collection of output physical quantities:
- Symbol Name or ID: Select from list or specify ID.
- Unit: Desired output unit (optional; uses default if empty).

Output

The node outputs an array of items, each containing a json field with the following structure:

  • All fields returned by the CalcsLive API response, including calculated physical quantities with their values and units.
  • A _metadata object containing:
    • articleId: The article ID used.
    • configMode: The configuration mode (enhanced or legacy).
    • executionTime: ISO timestamp of when the calculation was executed.

If the calculation is successful, the output includes the computed results as JSON. The node does not output binary data.

Dependencies

  • Requires an API key credential for authenticating with the CalcsLive API.
  • The node makes HTTP POST requests to the CalcsLive API endpoint (default base URL: https://www.calcs.live/api/n8n/v1/calculate).
  • Requires network access to the CalcsLive service.
  • No additional external dependencies beyond the API key and internet connectivity.

Troubleshooting

  • Calculation failed errors: If the API returns an error, the node throws an error with the message from the API. Check that the article ID is correct and that input values/units conform to the expected format.
  • Invalid units warning: When using enhanced mode, if a unit entered for a physical quantity is not valid for that quantity's category, a warning is logged but execution continues. Verify units against the article's available units.
  • Empty or missing inputs: In enhanced mode, if no value or unit is provided for an input physical quantity, the node attempts to auto-populate from the article defaults. If defaults are missing, the calculation may fail.
  • API authentication issues: Ensure the API key credential is correctly configured and has necessary permissions.
  • JSON parsing errors (Legacy mode): Inputs and outputs must be valid JSON strings or objects. Malformed JSON will cause errors.

Links and References


If you need further details about other operations or resources, please provide their names.

Discussion