Needle Get Field (any)
The wildcard output that turns JSON into whatever type you need
- result
- value
- string
- found
Here's the thing nobody tells you about the other Needle nodes: they hand you a JSON blob, and ComfyUI is a typed graph. A STRING won't plug into an INT socket, and the whole point of extracting a number out of text is that some downstream node needs an actual integer. Needle Get Field is the adapter. It takes a NEEDLE_RESULT - the object that Needle Extract and Workflow Parse both produce - pulls one field out, and hands it back as an ANY wildcard output that will connect to almost anything.
The name is doing the work. The value output is typed "*", which is ComfyUI's escape hatch: it accepts any source and can feed any sink. The pack implements it with the AnyType(str) subclass that satisfies both the modern wildcard check and the older __ne__-override idiom, so it's the rare node that genuinely connects on both old and new validation paths. One node feeds an INT, a STRING, a FLOAT - whatever the schema had in it, whatever the receiving node expects.
What you set
Four required inputs, and only two of them usually need touching:
- field - the name to pull. Dots walk nesting, so
address.citygets you the city out of a nested object. - cast -
auto(hand the value through as-is), or forcestring,int,float,boolean. Use this when the receiving node is picky. - default - what comes out when the field is missing. Needle omits fields it found no evidence for, so this is your safety net.
- result - the NEEDLE_RESULT wire in from Needle Extract or Workflow Parse.
Three outputs: value (the * wildcard), string (the same thing as text, for when you just want a STRING), and found (BOOLEAN - true only if the field actually existed in the result). That found output is quietly the most useful one here: it lets downstream logic know whether you got a real extraction or a default.
Why you should care about the ANY type
This is the classic trade, and the README is upfront about it. Because value is *, nothing is type-checked until the receiving node runs. A mistyped field name won't show up as a refused connection in the UI - it surfaces as a runtime error downstream, which is a much worse way to find out. The mitigations: use the cast widget to force the type you want, and check found before trusting the value. The default widget covers the "field missing" case; found covers the "I need to know whether that default is real" case.
The pattern to actually use it in
The classic combo: Needle Extract → Needle Get Field → KSampler (or whatever). Extract width, cast it int, wire it into an Empty Latent Image. Extract steps, wire it into KSampler. Same wire handles a string field in another part of the graph - that's the ANY magic.
The sneaky second use: Workflow Parse also emits a result in NEEDLE_RESULT shape, and every key the parser found is on it. So Needle Get Field is how you read anything off a parsed workflow that doesn't have its own dedicated output - the node's own docs say "every key found is also on the result output, so Needle Get Field reads anything without its own slot."
Install and gotchas
Same story as the rest of the pack - ComfyUI Manager, search ComfyUI Needle 2, or git clone https://github.com/DenRakEiw/Comfyui_Needle2 into custom_nodes/ and pip install cactus-needle. This node uses no model at all (it's pure dict-reading), so it's the one node in the pack that works even if the engine can't load on your machine.
The one thing that bites everyone once: you typed the field name wrong and the connection still accepted it, because * accepts anything. Read the found output, or the info output on the upstream node, and you'll spot it immediately.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| result | NEEDLE_RESULT | — | |
| field | STRING | subject | Field name. Use dots for nesting: a.b |
| cast | COMBO | auto | 5 options: auto, string, int, float, boolean |
| default | STRING | Used when the field is missing. Needle omits fields it found no evidence for. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| value | * | — |
| string | STRING | — |
| found | BOOLEAN | — |