CalcsLive Calculator icon

CalcsLive Calculator

Execute unit-aware calculations using CalcsLive articles

Overview

This node integrates with CalcsLive to perform unit-aware calculations based on predefined calculation articles. It allows users to input physical quantities with values and units, execute the calculation defined by a CalcsLive article, and retrieve results in specified units.

Common scenarios include:

  • Engineering or physics workflows where calculations like speed, distance, time, force, etc., need to be automated.
  • Converting between units while performing calculations.
  • Using trusted, pre-built calculation logic from CalcsLive articles without manual formula implementation.

Practical example:

  • Calculate speed given distance and time using the "Speed Distance Time Calculator" article by providing distance (e.g., 150 km) and time (e.g., 2 hours), then retrieving speed in mph or other units.

Properties

Name Meaning
Article ID The CalcsLive article ID or short ID identifying the calculation to run. Example: 3M5NVUCGW-3TA for Speed Distance Time Calculator.
Configuration Mode Choose how to configure inputs and outputs:
- Enhanced: User-friendly interface with dropdowns and auto-discovery of physical quantities.
- 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 calculation article. Example: { "D": { "value": 150, "unit": "km" }, "t": { "value": 2, "unit": "h" } }.
Outputs (Optional, Legacy mode) JSON object specifying desired output units for certain physical quantities. Leave empty to get all outputs with default units. Example: { "s": { "unit": "mph" } }.
Input Physical Quantities (Enhanced mode) Collection of input physical quantities:
- Symbol Name or ID: Select from list or specify manually.
- 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 manually.
- Unit: Desired output unit (optional; uses default if empty).

Output

The node outputs an array of items, each containing a json field with the API response from CalcsLive. The structure includes:

  • Calculation results keyed by physical quantity symbols, with values and units as returned by CalcsLive.
  • A _metadata object containing:
    • articleId: The article used for calculation.
    • configMode: The configuration mode used (enhanced or legacy).
    • executionTime: Timestamp of execution.

If the calculation fails, an error is thrown with the message from the API.

The node does not output binary data.

Dependencies

  • Requires an API key credential for CalcsLive API access.
  • Uses the CalcsLive API endpoint (default: https://www.calcs.live/api/n8n/v1/calculate).
  • Requires network connectivity to CalcsLive service.
  • The node expects the API key and base URL to be configured in credentials.

Troubleshooting

  • Common issues:

    • Invalid or missing API key: The node will fail authentication.
    • Incorrect Article ID: The API may return an error indicating the article was not found.
    • Malformed JSON in legacy mode inputs/outputs: Parsing errors can occur.
    • Units not recognized or incompatible: Warnings are logged if units do not match expected categories.
    • Empty or missing required input values: The node attempts to auto-populate defaults but may fail if data is incomplete.
  • Error messages:

    • "Calculation failed: <error>": Indicates the API returned an error; check the error message for details.
    • Node operation errors with messages from exceptions during execution.
  • Resolutions:

    • Verify API key validity and permissions.
    • Confirm Article ID correctness.
    • Use enhanced mode for easier configuration and validation.
    • Ensure JSON syntax correctness in legacy mode.
    • Provide valid units matching the calculation's expected categories.

Links and References

Discussion