Nodes/ComfyUI Griptape Nodes/Griptape Code: Run Griptape Cloud Structure
ComfyUI Node

Griptape Code: Run Griptape Cloud Structure

Run a Griptape Cloud structure from inside a ComfyUI workflow

By griptape-ai·Created 2 years ago·Updated about a year ago· 238
Griptape Code: Run Griptape Cloud Structure
  • agent
  • key_value_replacement
  • OUTPUT
  • AGENT
structure_id
split_input_into_argstrue
STRING
input_string

This is the "call out to the cloud" node. It takes a Griptape Cloud structure - a deployed, versioned agent or pipeline you've built on cloud.griptape.ai - and runs it from inside your ComfyUI graph, passing it arguments and getting back its text output. Think of it as the API-call node for the Griptape platform itself: your ComfyUI workflow becomes the caller, and a production-grade structure on Griptape's servers does the heavy lifting.

How it works

The node creates a StructureRunTask backed by a GriptapeCloudStructureRunDriver and runs it through an agent. You give it a structure_id (the deployed structure's ID, format xxxx-xxxx-xxxx-xxxx), and it resolves your GT_CLOUD_API_KEY from ComfyUI Settings → Griptape or the environment, just like every other key in the pack. The arguments you type get passed to the structure's run: by default the input string is split on newlines into separate arguments (split_input_into_args, default on) - turn that off to pass the whole thing as one argument. There's also a key_value_replacement dict input that does {{ key }} template substitution inside your input string.

The outputs are OUTPUT (the structure's text result, a STRING you can feed into other nodes) and AGENT (the agent used, so you can chain it forward if you want).

The inputs that matter

  • structure_id (required) - the deployed structure's ID from Griptape Cloud.
  • split_input_into_args (required, default on) - newline-splitting of your input string into positional args.
  • STRING (required) - the input arguments, one per line.
  • input_string (optional) - an alternative source for the input text.
  • agent (optional) - an agent to run through; one is created if you don't provide it.
  • key_value_replacement (optional, DICT) - {{ key }} → value substitutions.

Installing it

Standard pack install:

cd ComfyUI/custom_nodes
git clone https://github.com/griptape-ai/ComfyUI-Griptape

or ComfyUI Manager → search "Griptape". Restart. To use it you also need a Griptape Cloud account, a deployed structure, and your GT_CLOUD_API_KEY (get it at https://cloud.griptape.ai/configuration/api-keys) in Settings → Griptape. Note the pack's torch dependency (griptape[all]) is the usual post-install trouble spot; README troubleshooting has the fix.

When to use it

This is the recommended replacement for the deprecated "Run Python" node - the pack's own changelog points people here for security reasons: instead of exec-ing arbitrary code on your machine, you run vetted, deployed code on Griptape's infrastructure. If you're already building structures on Griptape Cloud, this is how you wire them into image/video workflows. If you're not, it's a bigger lift than the alternative - you need to build and deploy a structure first, so this node only pays off once you have one.

Common issues

  • GT_CLOUD_API_KEY not set - the usual warning; check Settings → Griptape.
  • Bad structure_id - a mistyped or non-existent structure ID fails at run time with a cloud error. Double-check the exact ID from the Cloud UI.
  • Arguments not splitting like you expect - remember split_input_into_args defaults to on; if your structure expects one big argument, flip it off.
  • {{ key }} not substituted - the key_value_replacement dict must actually be connected; empty dicts silently do nothing.
CategoryGriptape/Code

Inputs (6)

NameTypeDefaultDescription
structure_idSTRING
split_input_into_argsBOOLEANtrueIf enabled, the input string will be split into separate arguments by newline.
STRINGSTRINGSpecify input arguments that will be passed to the structure during execution.
input_stringoptSTRING
agentoptAGENT
key_value_replacementoptDICTThe will replace the {{ key }} with a value.

Outputs (2)

NameTypeDescription
OUTPUTSTRING
AGENTAGENT