Skip to Content

Data action reference

This page is generated from the plugin registry. Do not edit it by hand.

Reshape workflow data without writing a script: encode and decode strings, convert numbers between decimal and hex, hash a value with keccak256 or SHA-2, pull named fields out of upstream node output, filter an array or pull one field from every item, flatten monitoring results into a findings list, and hold static configuration on the canvas.

For guidance and examples see the Data guide.

Set actionType in a node’s config to the action type shown under each heading. See the workflow definition page for the node format.

ActionAction type
Compare Arraysdata/compare-arrays
Encode / Decodedata/encode
Extract Fieldsdata/extract-fields
Filter Arraydata/filter
Flatten Findingsdata/flatten-findings
Hashdata/hash
Static Configdata/static-config

Compare Arrays

Action type: data/compare-arrays. Connection: not required.

Compare two arrays, typically the value a previous run stored (State Get) against this run’s value, and report which items were added, removed or changed. Match items by value, or by a key field such as id. Pure comparison: chain State Get, this node and State Set to alert on changes and store the new list.

Inputs

FieldTypeRequiredDefaultAllowed valuesDescription
previousstringNoPrevious. A JSON array, usually State Get’s value. Empty, null or missing counts as an empty array, so the first run, where nothing is stored yet, works. Up to 10,000 items.
currentstringYesCurrent. A JSON array, this run’s value. Up to 10,000 items.
keyFieldstringNoKey field. Optional. Match items of objects by this field instead of by whole value.

Outputs

OutputDescription
successWhether the comparison succeeded
addedItems in Current that are not in Previous
removedItems in Previous that are not in Current
changedWith a Key field: the Current version of each item whose key is on both sides but whose content differs. Always empty without one
previousChangedThe Previous version of each changed item, in the same order as changed
unchangedItems present and identical on both sides
mergedPrevious with changed items replaced by their Current version and added items appended. Removed items are kept, so once it is stored they show as removed on every later run: check addedCount rather than hasChanges, or store Current to drop them
addedCountNumber of added items
removedCountNumber of removed items
changedCountNumber of changed items
hasChangesTrue when anything was added, removed or changed. Use it when you store Current; when you store merged, removed items stay in it, so check addedCount instead
errorError message if the comparison failed

Encode / Decode

Action type: data/encode. Connection: not required.

Convert a string (or a JSON array of strings) to padded hex (bytes8/bytes16/bytes32), raw hex or base64, and back again; or convert a decimal number to hex (minimal or a padded uint word) and back. Replaces hand-written string-to-bytes32 and number-to-hex loops.

Inputs

FieldTypeRequiredDefaultAllowed valuesDescription
operationstringYesencodeencode, decode, decimal-to-hex, hex-to-decimalOperation.
valuestringYesValue. A single value, or a JSON array of values to convert in one step. Encode / Decode work on text: SKY -> 0x534b590000… [“SKY”, “MKR”] -> result is an array, map is keyed by SKY and MKR Decimal to hex takes a non-negative integer of any size: 255 -> 0xff Hex to decimal takes hex with or without 0x, padded or not: 0x00…00ff -> 255.
formatstringYes, when shownbytes32bytes32, bytes16, bytes8, hex, base64Format. Shown when operation is one of encode, decode.
numberFormatstringNohexhex, uint256, uint128, uint64Number format. How wide the hex output is. A number is always padded on the left, so its value is unchanged. hex -> 0xff uint256 -> 0x00…00ff, the ABI word a contract argument expects A number too large for the chosen width fails the step rather than truncating. Shown when operation is decimal-to-hex.
paddingstringNorightright, leftPadding. Where the zero bytes go when text is encoded to, or decoded from, a fixed-size format. Solidity pads short strings on the right. Only applies to Encode and Decode. Decimal to hex always pads on the left, because zero bytes on the right would multiply the number. Shown when operation is one of encode, decode and format is one of bytes32, bytes16, bytes8.

Outputs

OutputDescription
successWhether the conversion succeeded
resultThe converted value: a string for a single input, an array for an array input
mapObject keyed by each original value, holding its converted value
countNumber of values converted
operationencode, decode, decimal-to-hex or hex-to-decimal
formatThe format used: the text format for encode and decode, the number format (hex, uint256, uint128 or uint64) for decimal-to-hex. Absent for hex-to-decimal, which has no format
errorError message if the conversion failed

Extract Fields

Action type: data/extract-fields. Connection: not required.

Pick named values out of one or more upstream node outputs by dotted path, returning null instead of failing when a path is missing.

Inputs

FieldTypeRequiredDefaultAllowed valuesDescription
sourcestringYesSource. A single upstream output, or a JSON object combining several so one node can pull fields from all of them.
pathsstringYesFields. One path per line. Use name = path to rename the output, or a bare path to keep its last segment as the name. vat = data.result.vat -> fields.vat data.result.jug -> fields.jug rows.0.amount -> fields.amount.
modestringNoobjectobject, arrayMode. Map over an array applies the same paths to every item in the source array and returns them in items.
onMissingstringNonullnull, empty, failWhen a path is missing.

Outputs

OutputDescription
successWhether extraction succeeded
fieldsObject of the extracted values, keyed by the name given to each path (object mode)
itemsArray of extracted objects, one per source item (array mode)
missingNames whose path was not found in the source
foundCountNumber of paths resolved
itemCountNumber of source items processed
errorError message if extraction failed

Filter Array

Action type: data/filter. Connection: not required.

Keep only the items of an array that pass a test, using the Condition operators plus does not contain / start with / end with, and pull one field out of every match into a flat array. Reports the source position (and an optional label) of each match and how many items could not be tested. Choose keep every item to only pull the field.

Inputs

FieldTypeRequiredDefaultAllowed valuesDescription
sourcestringYesSource. A JSON array, usually an upstream array field. Up to 10,000 items.
fieldstringNoField to test. Leave blank to test each item itself, e.g. an array of names. Shown when operator is not keepAll.
operatorstringYes======, !==, ==, !=, exists, doesNotExist, isNull, isNotNull, isUndefined, isNotUndefined, contains, notContains, startsWith, notStartsWith, endsWith, notEndsWith, matchesRegex, notMatchesRegex, isEmpty, isNotEmpty, >, >=, <, <=, isTrue, isFalse, arrayIsEmpty, arrayIsNotEmpty, arrayContains, arrayLength, objectIsEmpty, objectHasKey, keepAllOperator. The Condition tests, plus does not contain, does not start with and does not end with. Each test only looks at items it applies to: number tests at numbers, numeric text and hex; boolean tests at true and false; text tests at text and numbers; array and object tests at lists and objects. By default any other item fails the step; see If an item can’t be tested.
valuestringYes, when shownValue. What each item is compared with. Spaces around it are trimmed; quote it to keep them (except under regex). Matches regex and does not match regex: the regular expression exactly as it should run, e.g. ^VAULT_, without quotes or /…/ around it; no lookahead or back-references. To match a space at either end, write [ ] or \x20. Other text tests and has key: the text as typed, quotes removed. Number tests: a number, e.g. 100, 1.5 or 0x64. Array length: a whole number. Other tests: 5 is a number, true and false are booleans, null is null, anything else is text. Quote to force text, e.g. “true” matches the text, not the boolean. Quoting a number changes nothing under equals, which compares numbers by value. Shown when operator is not exists and operator is not doesNotExist and operator is not isNull and operator is not isNotNull and operator is not isUndefined and operator is not isNotUndefined and operator is not isEmpty and operator is not isNotEmpty and operator is not isTrue and operator is not isFalse and operator is not arrayIsEmpty and operator is not arrayIsNotEmpty and operator is not objectIsEmpty and operator is not keepAll.
ignoreCasebooleanNofalseIgnore case. Match text whatever its letter case, e.g. a checksummed address against a lowercase one. Shown when operator is not exists and operator is not doesNotExist and operator is not isNull and operator is not isNotNull and operator is not isUndefined and operator is not isNotUndefined and operator is not isEmpty and operator is not isNotEmpty and operator is not > and operator is not >= and operator is not < and operator is not <= and operator is not isTrue and operator is not isFalse and operator is not arrayIsEmpty and operator is not arrayIsNotEmpty and operator is not arrayLength and operator is not objectIsEmpty and operator is not objectHasKey and operator is not keepAll.
returnFieldstringNoReturn field. Dotted path pulled from each matching item into values. Leave blank to use Field to test. With Return field blank and either Field to test blank or keep every item, values holds the whole items. Example: Field to test success, Return field result. values then lists the result of every successful call.
missingReturnstringNokeepkeep, failIf a match has no Return field. A matching item without the Return field gets null in values and is counted in missingReturn. Fail the step instead when a missing field means the path is wrong, e.g. a typo in Return field.
labelsstringNoLabels. Optional. A list as long as Source, so an alert can name what matched.
untestablestringNofailfail, skipIf an item can’t be tested. An item can’t be tested when the field is missing, or its value is the wrong kind for the test: null under a number or boolean test, an object under a text test. A reverted batch read has result null, so it counts here. Fail the step is the default, so a read an attacker can make revert cannot pass quietly. Skip keeps the run going: branch on skipped > 0 to alert on it, and use skippedLabels to name the items. Shown when operator is not exists and operator is not doesNotExist and operator is not isNull and operator is not isNotNull and operator is not isUndefined and operator is not isNotUndefined and operator is not isEmpty and operator is not isNotEmpty and operator is not keepAll.

Outputs

OutputDescription
successWhether filtering succeeded
itemsThe items that passed the test
valuesThe Return field of each matching item, as a flat array (null where an item has no such field)
indexesSource position (from 0) of each matching item, to look up a parallel array
labelsThe Labels entry of each matching item (empty when Labels is not set), e.g. the contract names a batch read was given
countNumber of matching items
skippedIndexesSource position of each item the test could not apply to
skippedLabelsThe Labels entry of each skipped item (empty when Labels is not set), e.g. the contract whose read failed
missingReturnNumber of matching items that have no Return field; their value is null
skippedNumber of items the test could not apply to, e.g. a missing field or null under a number test
totalNumber of items in the source
errorError message if filtering failed

Flatten Findings

Action type: data/flatten-findings. Connection: not required.

Flatten several monitoring results into one findings list with per-source labels and severities, plus a ready-to-alert count and summary.

Inputs

FieldTypeRequiredDefaultAllowed valuesDescription
sourcesstringYesSources. JSON array of sources. Each entry needs a label and a value. value accepts: an object with events / transactions / logs / rows / items / results (each element becomes a finding), an array (each element becomes a finding), a boolean (true is one finding), or any other object (one finding). Optional per-entry keys: severity, and itemsPath to point at a nested array.
defaultSeveritystringNowarningDefault Severity. Used for any source that does not carry its own severity key.
hashFieldstringNotransactionHashHash Field. Dotted path inside each finding to read a transaction hash from, used for firstHash.
maxFindingsnumberNo100min 1Max Findings. Cap on the findings array so a runaway source cannot blow up the alert payload. count still reports the true total.

Outputs

OutputDescription
successWhether the scan succeeded
anyFoundTrue when at least one source produced a finding
countTotal number of findings
findingsArray of { label, severity, hash, item } - one entry per finding
labelsLabels of the sources that produced findings
firstHashThe first transaction hash found across all findings, or null
summaryHuman-readable per-label summary for an alert body
truncatedTrue when findings was capped by Max Findings
errorError message if the scan failed

Hash

Action type: data/hash. Connection: not required.

Hash a value (or a JSON array of values) with keccak256, SHA-2, SHA3-256, RIPEMD-160 or BLAKE2b. One-way, unlike Encode / Decode. Optionally truncate and right-pad the digest to produce a function selector or an event topic.

Inputs

FieldTypeRequiredDefaultAllowed valuesDescription
algorithmstringYeskeccak256blake2b-256, keccak256, ripemd160, sha256, sha512, sha3-256Algorithm. keccak256 is the hash the EVM uses: function selectors and event topics, including the topic that carries an indexed string or bytes argument. SHA3-256 is NOT the same thing. Ethereum adopted Keccak before NIST changed the padding, so the two give completely different results for the same input. Pick SHA3-256 only if a non-EVM protocol asked for it by that name.
valuestringYesValue. A single value, or a JSON array of values to hash in one step. For an array, result is an array and map is keyed by each original value. A single value is trimmed, so a stray trailing newline cannot change the digest. Array elements are not, so [” a ”] hashes the spaces too. An empty value is hashed rather than refused: keccak256 of nothing is c5d24601… , the EXTCODEHASH of an account with no code.
inputEncodingstringYesutf8utf8, hex, base64Input encoding. How the value is read before hashing, and the easiest thing to get wrong. Given 0x1234, Text hashes the six characters 0 x 1 2 3 4, while Hex bytes hashes the two bytes 0x12 0x34. Both succeed and give different answers. Function and event signatures are Text. A raw byte payload from an upstream node is Hex bytes. Base64 is for a payload that arrived encoded - a webhook body, a signed blob - where decoding it to text first would corrupt any byte that is not valid UTF-8. Base64 accepts either alphabet, standard or URL-safe, with or without padding, but not a mixture of the two.
outputBytesnumberNomin 1Output bytes. Keep only the first N bytes of the digest. Leave blank for the full digest. Set 4 to turn a function signature into its selector: frob(bytes32,address,address,address,int256,int256) -> 0x76088703 A truncated digest is not the shorter standard hash of the same family. SHA-512 cut to 32 bytes is not SHA-512/256, and BLAKE2b-256 is not BLAKE2b-512 cut down: both mix the output length into their initial state. Truncate for a selector, not to derive a shorter named hash.
padTonumberNomin 1Pad to. Right-pad the result with zero bytes to this width. Leave blank for no padding. With Output bytes 4 and Pad to 32 you get the 32-byte topic that filters an anonymous LogNote event: 0x7608870300000000000000000000000000000000000000000000000000000000 Padding is on the right because that is where the EVM puts it - the selector sits left-aligned in the topic word.
outputFormatstringNohexhex, base64, base64urlOutput format. hex is what every on-chain use wants: a topic or a bytes32 argument. base64url swaps + and / for - and _ and drops the padding, so the digest can go into a URL, a filename or a header without further escaping. For a digest as a decimal number, feed hex into Encode / Decode with Hex to decimal, which stays exact above 2^53.

Outputs

OutputDescription
successWhether hashing succeeded
resultThe digest: a string for a single input, an array for an array input
mapObject keyed by each original value, holding its digest
countNumber of values hashed
algorithmThe algorithm used
digestBytesWidth of each digest in bytes, after any truncation and padding
errorError message if hashing failed

Static Config

Action type: data/static-config. Connection: not required.

Hold static JSON configuration on the canvas - address lists, constants, wallet registries - without wrapping it in a script.

Inputs

FieldTypeRequiredDefaultAllowed valuesDescription
valuestringYesValue. Any JSON value. Downstream nodes read it with {{@this-node:Label.result}} and can index into it, e.g. result.vat.

Outputs

OutputDescription
successWhether the JSON parsed
resultThe configuration value
keysTop-level keys when the value is an object
countNumber of keys for an object, or entries for an array
valueTypeobject, array or primitive
errorError message if the JSON is invalid