0-CodeKit icon

0-CodeKit

A toolbox of no-code utilities

Overview

This node provides a set of operations for managing global variables in a storage resource. It allows you to add, retrieve, delete, and list global variables that can be used across your n8n workflows. This is particularly useful for storing configuration values, tokens, or any data that needs to persist between workflow executions.

Common scenarios:

  • Storing API keys or tokens for use in multiple workflows.
  • Saving counters, flags, or other stateful information.
  • Sharing data between different parts of a workflow or between different workflows.

Practical examples:

  • Add a new global variable to store an access token.
  • Retrieve a global variable containing a configuration value.
  • Delete a global variable when it is no longer needed.
  • List all global variables to audit what is stored.

Properties

Name Meaning
Choose a JSON Bin Operation Selects the operation to perform on global variables. Options: "Add a New Global Variable", "Get a Global Variable", "Delete a Global Variable", "List All Your Global Variables".
Variable Name The name of the global variable. Required for "Add a New Global Variable" and "Get a Global Variable" operations.
Variable Value The value to assign to the global variable. Required for "Add a New Global Variable" operation.
Variable ID The unique identifier of the global variable. Required for "Delete a Global Variable" operation. You can obtain this by listing all global variables.

Output

The output structure depends on the selected operation:

  • Add a New Global Variable:
    Returns a JSON object with details about the newly created variable, such as its name, value, and unique identifier.

  • Get a Global Variable:
    Returns a JSON object containing the variable's name and value.

  • Delete a Global Variable:
    Returns a confirmation JSON object indicating successful deletion (may include the deleted variable's ID).

  • List All Your Global Variables:
    Returns an array of JSON objects, each representing a global variable with its name, value, and unique identifier.

Dependencies

  • External Service: Requires access to the CodeKit API.
  • Credentials: You must configure the codeKitApi credential in n8n for authentication.

Troubleshooting

Common issues:

  • Missing or incorrect credentials:
    If the codeKitApi credential is not configured or invalid, requests will fail.
  • Variable not found:
    Attempting to get or delete a variable that does not exist will result in an error.
  • Incorrect Variable ID:
    Deleting requires the correct Variable ID. Use the "List All Your Global Variables" operation to find the right ID.

Error messages:

  • "error": "Error: <message>"
    Errors are returned in the output if "Continue On Fail" is enabled; otherwise, the workflow execution stops. Check the error message for details such as missing parameters or invalid IDs.

Links and References

Discussion