Task Types
This guide outlines different task types.
Anchor task
Rebases a lower or upper sample stream onto a pre-winsorized reference stream, then returns the weighted mean. For each surviving source, the task derives a displacement from the spread between the low and high samples and applies it to the reference value. Sources missing from the low or high stream are dropped. This task is marked experimental in the node source.
Parameters
reference: an array of samples to anchor to. This stream should already be winsorized.low: an array of lower samples, one per source.high: an array of upper samples, one per source.select: optional. Whether to anchor to the low or the high stream. Useloworhigh. Defaults tolow.minWeightMass: optional. The minimum surviving weight mass required for the task to return a result. Defaults to0.precision: optional. The number of decimal places to retain in the result.
Outputs
The weighted mean of the anchored samples.
Example
anchor [type="anchor"
reference="$(winsorized)"
low="$(low_samples)"
high="$(high_samples)"
select="low"
minWeightMass="0"
precision=8]
'Any' task
Returns a random value from the set of inputs passed in.
Parameters
None.
Inputs
Can be anything.
Outputs
A randomly-selected value from the set of inputs.
Example
fetch1 [type="http" ...]
fetch2 [type="http" ...]
fetch3 [type="http" ...]
pick_any [type="any"]
fetch1 -> pick_any
fetch2 -> pick_any
fetch3 -> pick_any
pick_any will return either the result of fetch1, fetch2, or fetch3.
Base64 Decode task
Accepts a base64 encoded string and returns decoded bytes.
Parameters
input: a base64 encoded string.
Outputs
Decoded bytes.
Example
my_base64decode_task [type="base64decode" input="SGVsbG8sIHBsYXlncm91bmQ="]
Given the input SGVsbG8sIHBsYXlncm91bmQ=, the task will return Hello, playground (as ASCII bytes).
Base64 Encode task
Encodes bytes/string into a Base64 string.
Parameters
input: Byte array or string to be encoded.
Outputs
String with Base64 encoding of input.
Example
my_base64encode_task [type="base64encode" input="Hello, playground"]
Given the input string "Hello, playground", the task will return "SGVsbG8sIHBsYXlncm91bmQ=".
Bridge task
Bridge tasks make HTTP POST requests to pre-configured URLs. Bridges can be configured via the UI or the CLI, and are referred to by a simple user-specified name. This is the way that most jobs interact with External Adapters.
Parameters
name: an arbitrary name given to the bridge by the node operator.requestData(optional): a statically-defined payload to be sent to the external adapter.cacheTTL(optional): a duration-formatted string indicating the maximum acceptable staleness for cached bridge responses in case of intermittent failures. This is disabled by default.headers(optional): an array of strings. The number of strings must be even. Example:foo [type="bridge" name="foo" headers="[\\"X-Header-1\\", \\"value1\\", \\"X-Header-2\\", \\"value2\\"]"]
Outputs
A string containing the response body.
Example
my_bridge_task [type="bridge"
name="some_bridge"
requestData="{\\"data\\":{\\"foo\\": $(foo), \\"bar\\": $(bar)}}"
]
CBOR Parse task
CBOR Parse tasks parse a CBOR payload, typically as part of a Direct Request workflow. In Direct Request, a user makes an onchain request using a ChainlinkClient contract, which encodes the request parameters as CBOR. See below for an example.
Parameters
data: A byte array containing the CBOR payload.mode: An optional parameter that specifies how to parse the incoming CBOR. The default mode isdiet, which expects the input to be a map. Set the mode tostandardto pass literal values through "as-is". Empty inputs return nil.
Outputs
A map containing the request parameters. Parameters can be individually accessed using $(dot.accessors).
Example
// First, we parse the request log and the CBOR payload inside of it
decode_log [type="ethabidecodelog"
data="$(jobRun.logData)"
topics="$(jobRun.logTopics)"
abi="SomeContractEvent(bytes32 requestID, bytes cborPayload)"]
decode_cbor [type="cborparse"
data="$(decode_log.cborPayload)"]
// Then, we use the decoded request parameters to make an HTTP fetch
fetch [type="http" url="$(decode_cbor.fetchURL)" method=GET]
parse [type="jsonparse" path="$(decode_cbor.jsonPath)" data="$(fetch)"]
// ... etc ...
See the Direct Request page for a more comprehensive example.
Coalesce task
Returns the first input that is neither an error nor nil, or nil if there are none.
Parameters
None.
Inputs
One or more inputs.
Outputs
The value of the first input that did not error and is not nil. Returns nil when every input errored or was nil.
Example
primary [type="http" method=GET url="https://primary.example.com"]
secondary [type="http" method=GET url="https://secondary.example.com"]
pick [type="coalesce"]
primary -> pick
secondary -> pick
Conditional task
Fails the run unless data resolves to true.
Parameters
data: the boolean to check. Can be a literal, a$(variable), or the single pipeline input.
Outputs
true when the condition is satisfied. The task errors with conditional was not satisfied when it is not.
Example
check [type="conditional" data="$(should_continue)"]
Divide task
Divides the provided input by the divisor and returns the result with a number of decimal places defined in the precision value.
Parameters
input: The value to be divided- number
- stringified number
- bytes-ified number
$(variable)
divisor: The value by which to divide theinput- number
- stringified number
- bytes-ified number
$(variable)
precision: The number of decimal places to retain in the result- number
- stringified number
- bytes-ified number
$(variable)
Outputs
The result of the division.
Example
my_divide_task [type="divide"
input="$(json_parse_result)"
divisor="3"
precision="2"]
Given the input 10, this example returns 3.33.
Estimate Gas Limit task
Estimates the gas required for a transaction and returns the estimate as a uint64. If the estimate cannot be obtained, the task falls back to the configured maximum gas limit for the job.
Parameters
from: the address the transaction would be sent from. Defaults to the zero address.to: the address of the contract to call.data: the data to attach to the call, including the function selector.multiplier: optional. The multiplier applied to the estimated gas. Defaults to1.evmChainID: optional. The chain on which to estimate. Defaults to the chain ID of the job.block: optional. The block at which to estimate, for examplelatest.
Outputs
The estimated gas limit as a uint64.
Example
estimate_gas [type="estimategaslimit"
to="0x613a38AC1659769640aaE063C651F48E0250454C"
multiplier="1.1"
data="$(vrf.output)"]
ETH ABI Decode Log task
Decodes a log emitted by an ETH contract.
Parameters
abi: a canonical ETH log event definition. Should be formatted exactly as in Solidity. Each argument must be named. Examples:NewRound(uint256 indexed roundId, address indexed startedBy, uint256 startedAt)AuthorizedSendersChanged(address[] senders)
data: the ABI-encoded log data. Can be:- a byte array
- a hex-encoded string beginning with
0x - ... but generally should just be set to
$(jobRun.logData)(see the Direct Request page)
topics: the ABI-encoded log topics (i.e., theindexedparameters)- an array of bytes32 values
- an array of hex-encoded bytes32 values beginning with
0x - ... but generally should just be set to
$(jobRun.logTopics)(see the Direct Request page)
Outputs
A map containing the decoded values.
Example
decode [type="ethabidecodelog"
abi="NewRound(uint256 indexed roundId, address indexed startedBy, uint256 startedAt)"
data="$(jobRun.logData)"
topics="$(jobRun.logTopics)"]
This task will return a map with the following schema:
{
"roundId": ..., // a number
"startedBy": ..., // an address
"startedAt": ..., // a number
}
ETH ABI Decode task
Decodes a ETH ABI-encoded payload, typically the result of an ETH Call task.
Parameters
abi: a canonical ETH ABI argument string. Should be formatted exactly as in Solidity. Each argument must be named. Examples:uint256 foo, bytes32 bar, address[] bazaddress a, uint80[3][] u, bytes b, bytes32 b32
data: the ABI-encoded payload to decode. Can be:- a byte array
- a hex-encoded string beginning with
0x
Outputs
A map containing the decoded values.
Example
decode [type="ethabidecode"
abi="bytes32 requestID, uint256 price, address[] oracles"
data="$(eth_call_result)"]
This task will return a map with the following schema:
{
"requestID": ..., // [32]byte value
"price": ..., // a number
"oracles": [
"0x859AAa51961284C94d970B47E82b8771942F1980",
"0x51DE85B0cD5B3684865ECfEedfBAF12777cd0Ff8",
...
]
}
ETH ABI Encode task
Encodes a bytes payload according to ETH ABI encoding, typically in order to perform an ETH Call or an ETH Tx.
Parameters
abi: a canonical ETH ABI argument string. Should be formatted exactly as in Solidity. Each argument must be named. If a method name is provided, the 4-byte method signature is prepended to the result. Examples:uint256 foo, bytes32 bar, address[] bazfulfillRequest(bytes32 requestID, uint256 answer)
data: a map of the values to be encoded. The task will make a best effort at converting values to the appropriate types.
Outputs
A byte array.
Example
encode [type="ethabiencode"
abi="fulfillRequest(bytes32 requestID, uint256 answer)"
data="{\\"requestID\\": $(foo), \\"answer\\": $(bar)}"
]
ETH ABI Encode 2 task
Encodes a bytes payload according to ETH ABI encoding, using a JSON method definition for the ABI. Unlike the ETH ABI Encode task, which takes a Solidity signature string, this task takes the ABI as a JSON object with name and inputs. When name is set, the 4-byte method signature is prepended to the result.
Parameters
abi: a JSON object describing the method, with anameand a list ofinputs. Each input has anameand atype. Example:{"name":"fulfillRequest","inputs":[{"name":"requestID","type":"bytes32"},{"name":"answer","type":"uint256"}]}
data: a map of the values to be encoded.
Outputs
A byte array.
Example
encode [type="ethabiencode2"
abi="{\\"name\\":\\"fulfillRequest\\",\\"inputs\\":[{\\"name\\":\\"requestID\\",\\"type\\":\\"bytes32\\"},{\\"name\\":\\"answer\\",\\"type\\":\\"uint256\\"}]}"
data="{\\"requestID\\": $(decode_log.requestId), \\"answer\\": $(parse)}"]
ETH Call task
Makes a non-mutating contract call to the specified contract with the specified data payload.
Parameters
contract: the address of the contract to call.data: the data to attach to the call (including the function selector).gas: the amount of gas to attach to the transaction.from: The from address with which the call should be made. Defaults to zero address.gasPrice: The gasPrice for the call. Defaults to zero.gasTipCap: The gasTipCap (EIP-1559) for the call. Defaults to zero.gasFeeCap: The gasFeeCap (EIP-1559) for the call. Defaults to zero.gasUnlimited: A boolean indicating if unlimited gas should be provided for the call. If set to true, do not pass thegasparameter.evmChainID: Set this optional parameter to transmit on the given chain. You must have the chain configured with RPC nodes for this to work. If left blank, it will use the default chain.
Outputs
An ABI-encoded byte array containing the return value of the contract function.
Example
encode_call [type="ethabiencode"
abi="checkUpkeep(bytes data)"
data="{ \\"data\\": $(upkeep_data) }"]
call [type="ethcall"
contract="0xa36085F69e2889c224210F603D836748e7dC0088"
data="$(encode_call)"
gas="1000"]
decode_result [type="ethabidecode"
abi="bool upkeepNeeded, bytes performData"
data="$(call)"]
encode_call -> call -> decode_result
ETH Tx task
Makes a mutating transaction to the specified contract with the specified data payload. The transaction is guaranteed to succeed eventually.
Parameters
from: one or more addresses of the externally-owned account from which to send the transaction. If left blank, it will select a random address on every send for the given chain ID.to: the address of the contract to make a transaction to.data: the data to attach to the call (including the function selector). Most likely, this will be the output of anethabiencodetask.gasLimit: the amount of gas to attach to the transaction.txMeta: a map of metadata that is saved into the database for debugging.minConfirmations: minimum number of confirmations required before this task will continue. Set to zero to continue immediately. Note that this does not affect transaction inclusion. All transactions will always be included in the chain up to the configured finality depth.evmChainID: set this optional parameter to transmit on the given chain. You must have the chain configured with RPC nodes for this to work. If left blank, it will use the default chain.failOnRevert: an optional parameter, a boolean, that allows a ChainLink node operator's UI to display and color the status of the task within a job's pipeline depending on a transaction status. default: false.
Outputs
The hash of the transaction attempt that eventually succeeds (after potentially going through a gas bumping process to ensure confirmation).
Example
encode_tx [type="ethabiencode"
abi="performUpkeep(bytes performData)"
data="{ \\"data\\": $(upkeep_data) }"]
submit_tx [type="ethtx"
to="0xa36085F69e2889c224210F603D836748e7dC0088"
data="$(encode_tx)"
failOnRevert="true"]
encode_tx -> submit_tx
Fail task
Returns an error with the configured message. This task is marked as testing only in the node source.
Parameters
msg: the error message.
Outputs
The task always errors with msg.
Example
fail [type="fail" msg="stopping here"]
Hex Decode task
Accepts a hexadecimal encoded string and returns decoded bytes.
Parameters
input: a hexadecimal encoded string, must have prefix0x.
Outputs
Decoded bytes.
Example
my_hexdecode_task [type="hexdecode" input="0x12345678"]
Given the input 0x12345678, the task will return [0x12, 0x34, 0x56, 0x78].
Hex Encode task
Encodes bytes/string/integer into a hexadecimal string.
Parameters
input: Byte array, string or integer to be encoded.
Outputs
Hexadecimal string prefixed with "0x" (or empty string if input was empty).
Example
my_hexencode_task [type="hexencode" input="xyz"]
Given the input string "xyz", the task will return "0x78797a", which are the ascii values of characters in the string.
HTTP task
HTTP tasks make HTTP requests to arbitrary URLs.
Parameters
method: the HTTP method that the request should use.url: the URL to make the HTTP request to.requestData(optional): a statically-defined payload to be sent to the external adapter.allowUnrestrictedNetworkAccess(optional): permits the task to access a URL atlocalhost, which could present a security risk. Note that Bridge tasks allow this by default.headers(optional): an array of strings. The number of strings must be even. Example:foo [type=http headers="[\\"X-Header-1\\", \\"value1\\", \\"X-Header-2\\", \\"value2\\"]"]
Outputs
A string containing the response body.
Example
my_http_task [type="http"
method=PUT
url="http://chain.link"
requestData="{\\"foo\\": $(foo), \\"bar\\": $(bar), \\"jobID\\": 123}"
allowUnrestrictedNetworkAccess=true
]
JSON Parse task
JSON Parse tasks parse a JSON payload and extract a value at a given keypath.
Parameters
data: the JSON string. Can be:- string
- byte array
path: the keypath to extract. Must be a comma-delimited list of keys, or specify a customseparatoralternative.separator: (optional) custompathkey separator. Defaults to comma (,).lax(optional): if false (or omitted), and the keypath doesn't exist, the task will error. If true, the task will returnnilto the next task.
Outputs
The value at the provided keypath.
Example
my_json_task [type="jsonparse"
data="$(http_fetch_result)"
path="data,0,price"]
This task returns 123.45 (float64) when given the following example data value:
{
"data": [{ "price": 123.45 }, { "price": 678.9 }]
}
Length task
Returns the length of a byte array or string.
Parameters
input: Byte array, or string to get the length for.
Outputs
The length of the byte array or string.
Note: For strings containing multi-byte unicode characters, the output is the length in bytes and not number of characters.
Example
my_length_task [type="length" input="xyz"]
Given the input string "xyz", the task will return 3, length of the string.
Less Than task
Returns a boolean, result of computing left LESS_THAN right.
Parameters
left: the left hand side of comparison. Possible values:- number
- stringified number
- bytes-ified number
$(variable)
right: the right hand side of comparison. Possible values:- number
- stringified number
- bytes-ified number
$(variable)
Outputs
The result of less than comparison.
Example
my_lessthan_task [type="lessthan" left="3" right="10"]
the task will return true which is the result of 3 LESS_THAN 10
Lookup task
Looks up a key in a map input and returns the value at that key.
Parameters
key: the key to look up in the input map.
Inputs
A single map input.
Outputs
The value at key. The value is nil when the key is not present.
Example
lookup [type="lookup" key="ethusd"]
Lowercase task
Accepts a string and returns a lowercase string.
Parameters
input: a string.
Outputs
Lowercase string.
Example
my_lowercase_task [type="lowercase" input="Hello World!"]
Given the input Hello World!, the task will return hello world!.
Max task
Accepts multiple numerical inputs and returns the maximum of them.
Parameters
values: an array of values from which to select the maximum.allowedFaults(optional): the maximum number of input tasks that can error without the Max task erroring. If not specified, this value defaults toN - 1, whereNis the number of inputs.lax(optional): when disabled (the default), the task errors if there are no input values or if the input includes nil values. When enabled, the task returns nil with no error if there are no valid input values, and nil values are excluded from the calculation and do not count as a fault.
Outputs
The maximum of the values in the values array.
Example
my_max_task [type="max"
values=<[ $(fetch1), $(fetch2), $(fetch3) ]>
allowedFaults=1]
Given the inputs 2, 5, and 20, the task will return 20.
Mean task
Accepts multiple numerical inputs and returns the mean (average) of them.
Parameters
values: an array of values to be averaged.allowedFaults(optional): the maximum number of input tasks that can error without the Mean task erroring. If not specified, this value defaults toN - 1, whereNis the number of inputs.precision: the number of decimal places in the result.
Outputs
The average of the values in the values array.
Example
my_mean_task [type="mean"
values=<[ $(fetch1), $(fetch2), $(fetch3) ]>
precision=2
allowedFaults=1]
Given the inputs 2, 5, and 20, the task will return 9.
Median task
Accepts multiple numerical inputs and returns the median of them.
Parameters
values: an array of values from which to select a median.allowedFaults(optional): the maximum number of input tasks that can error without the Median task erroring. If not specified, this value defaults toN - 1, whereNis the number of inputs.
Outputs
The median of the values in the values array.
Example
my_median_task [type="median"
values=<[ $(fetch1), $(fetch2), $(fetch3) ]>
allowedFaults=1]
Given the inputs 2, 5, and 20, the task will return 5.
Memo task
The memo task returns its value as a result.
Parameters
value: value to return. Possible values:- number
- boolean
- float
- string
- array
Outputs
The value.
Example
memo [type="memo" value="10"]
The task will return the value 10
Merge task
Merge task returns the merged value of two maps.
Parameters
left: The left map.right: The right map, which overwrites the left side.
Outputs
Returns the combined map of left and right. If the merged map is invalid, it returns null.
Example
merge [type="merge" left="{\\"foo\\":\\"abc\\", \\"bar\\":\\"123\\"}" right="{\\"bar\\":\\"xyz\\", \\"biz\\":\\"buzz\\"}"]
This example task returns the following map:
{ "foo": "abc", "bar": "xyz", "biz": "buzz" }
Min task
Accepts multiple numerical inputs and returns the minimum of them.
Parameters
values: an array of values from which to select the minimum.allowedFaults(optional): the maximum number of input tasks that can error without the Min task erroring. If not specified, this value defaults toN - 1, whereNis the number of inputs.lax(optional): when disabled (the default), the task errors if there are no input values or if the input includes nil values. When enabled, the task returns nil with no error if there are no valid input values, and nil values are excluded from the calculation and do not count as a fault.
Outputs
The minimum of the values in the values array.
Example
my_min_task [type="min"
values=<[ $(fetch1), $(fetch2), $(fetch3) ]>
allowedFaults=1]
Given the inputs 2, 5, and 20, the task will return 2.
Mode task
Accepts multiple numerical inputs and returns the mode (most common) of them. If more than one value occur the maximum number of times, it returns all of them.
Parameters
values: an array of values from which to select a mode.allowedFaults(optional): the maximum number of input tasks that can error without the Mode task erroring. If not specified, this value defaults toN - 1, whereNis the number of inputs.
Outputs
A map containing two keys:
{
"results": [ ... ], // An array containing all of the values that occurred the maximum number of times
"occurrences": ..., // The number of times those values occurred
}
Example
my_mode_task [type="mode"
values=<[ $(fetch1), $(fetch2), $(fetch3), $(fetch4), $(fetch5), $(fetch6), $(fetch7), $(fetch8) ]>
allowedFaults=3]
This task can handle arrays with mixed types. For example, given a values array containing both strings and ints like [ 2, 5, 2, "foo", "foo" "bar", "foo", 2 ], the task returns the following JSON:
{
"occurrences": 3,
"results": [2, "foo"]
}
To encode the results array into the ethabiencode task, specify that the data is an array in the abi and point the data parameter to the results from your mode task. Because argument encoding enforces types, all of the values in the array must be of the same type. As an example, you can encode the results of a mode task with an array of integers:
mode_task [type="mode" values=<[ 1, 2, 2, 3, 1 ]>]
encode_mode_task [type="ethabiencode" abi="(bytes32 requestId, uint64 occurrences, uint256[] results)" data="{\\"requestId\\": $(decode_log.requestId), \\"occurrences\\": $(mode_task.occurrences), \\"results\\": $(mode_task.results) }"]
In this example, the mode task returns the following result:
{
"occurrences": 2,
"results": [2, 1]
}
The ethabiencode task encodes results as a uint256[] array.
Multiply task
Multiplies the provided input and times values.
Parameters
input: the value to be multiplied. Possible values:- number
- stringified number
- bytes-ified number
$(variable)
times: the value to multiply the input with.- number
- stringified number
- bytes-ified number
$(variable)
Outputs
The result of the multiplication.
Example
my_multiply_task [type="multiply" input="$(json_parse_result)" times=3]
Given the input 10, the task will return 30.
Normalize task
Converts sample values onto a common unit using a unit to factor map. Samples that are already in the target unit, or that carry no unit, pass through unchanged. This task is marked experimental in the node source.
Parameters
samples: an array of samples, or the pipeline input.unitMap: an optional map of unit names to factors. Each factor may be a raw number or a sample. Required whenenabledis true.targetUnit: the unit that the output samples are converted to.enabled: optional. Defaults totrue.onMissingRate: optional. What to do when a sample's unit has no factor inunitMap. Defaults todrop. Any other value makes the task error instead.
Outputs
An array of samples with all values expressed in targetUnit. Unconvertible samples are dropped, or cause an error, depending on onMissingRate.
Panic task
Panics with the configured message. This task is marked as testing only in the node source.
Parameters
msg: the panic message.
Example
panic [type="panic" msg="stopping here"]
Sample task
Wraps an upstream result into a sample. A sample bundles a value with the metadata (source, weight, unit, timestamp) that the aggregation tasks consume. This task is marked experimental in the node source.
Parameters
input: the upstream result to read the value from. Defaults to the single pipeline input.source: the source name. Used for grouping and weighting.weight: optional. The nominal weight of the sample. Defaults to1.unit: optional. The unit of the value. An empty value means the value is already in the common unit.tag: optional. A free label, used for diagnostics only.valuePath: the JSON path to the value insideinput.tsPath: the JSON path to the timestamp insideinput.tsUnit: optional. The unit of the timestamp. Defaults toms.decimals: optional. The number of decimals to scale the value by.
Outputs
A sample with the fields source, value, ts_ms, weight, unit, and tag.
Staleness task
Decays the weight of each sample by its age, so that older samples count for less in downstream aggregation. This task is marked experimental in the node source.
Parameters
samples: an array of samples, or the pipeline input.method: the decay method to apply.threshold: optional. The age beyond which a sample is considered stale.halfLife: optional. The age at which a sample's weight is halved. Defaults to0s.cutoff: optional. The maximum age of a sample.decayThreshold: optional. The weight below which a sample is dropped.
Outputs
An array of samples with adjusted weight values.
Sum Task
Accepts multiple numerical inputs and returns the sum of them.
Parameters
values: an array of values to sum.allowedFaults(optional): the maximum number of input tasks that can error without the Sum task erroring. If not specified, this value defaults toN - 1, whereNis the number of inputs.
Outputs
The sum of the values in the values array.
Example
my_sum_task [type="sum"
values=<[ $(fetch1), $(fetch2), $(fetch3) ]>
allowedFaults=1]
Given the inputs 2, 5, and 20, the task will return 27.
Uppercase task
Accepts a string and returns an uppercase string.
Parameters
input: a string.
Outputs
Uppercase string.
Example
my_uppercase_task [type="uppercase" input="Hello World!"]
Given the input Hello World!, the task will return HELLO WORLD!.
VRF V2 task
Generates a VRF v2 proof from a request log. It takes the decoded log as its single input and returns the encoded proof.
Parameters
publicKey: the public key of the VRF key that this node uses to generate the proof.requestBlockHash: the hash of the block in which the request log was received. Usually set to$(jobRun.logBlockHash).requestBlockNumber: the number of the block in which the request log was received. Usually set to$(jobRun.logBlockNumber).topics: the log's topics. Usually set to$(jobRun.logTopics).
Inputs
A single decoded request log, normally from an ETH ABI Decode Log task.
Outputs
A map with an output key that holds the encoded proof.
Example
vrf [type="vrfv2"
publicKey="$(jobSpec.publicKey)"
requestBlockHash="$(jobRun.logBlockHash)"
requestBlockNumber="$(jobRun.logBlockNumber)"
topics="$(jobRun.logTopics)"]
VRF V2Plus task
Generates a VRF v2plus proof from a request log. It is identical to the VRF V2 task, except that it uses the V2Plus request commitment, which includes a flag that indicates whether the request is paid in native tokens or in LINK.
Parameters
publicKey: the public key of the VRF key that this node uses to generate the proof.requestBlockHash: the hash of the block in which the request log was received. Usually set to$(jobRun.logBlockHash).requestBlockNumber: the number of the block in which the request log was received. Usually set to$(jobRun.logBlockNumber).topics: the log's topics. Usually set to$(jobRun.logTopics).
Inputs
A single decoded request log, normally from an ETH ABI Decode Log task.
Outputs
A map with an output key that holds the encoded proof.
Example
vrf [type="vrfv2plus"
publicKey="$(jobSpec.publicKey)"
requestBlockHash="$(jobRun.logBlockHash)"
requestBlockNumber="$(jobRun.logBlockNumber)"
topics="$(jobRun.logTopics)"]
Weighted Mean task
Gates on a minimum weight mass, optionally clamps each sample's value into a band around the cross-sectional median, then returns the weighted mean. With no method set it computes a plain weighted mean with no clamping. This task is marked experimental in the node source.
Parameters
samples: an array of samples, or the pipeline input. Normally the output of a Staleness task, one sample per source.reference: optional. An array of samples to derive the clamp band from.band: optional. The width of the clamp band. Defaults to0.03.minWeightMass: optional. The minimum surviving weight mass required for the task to return a result. Defaults to0.method: optional. The winsorization method to apply. Empty, the default, means no clamping.winsorRef: optional. The reference used for winsorization. Defaults tomedian.precision: optional. The number of decimal places to retain in the result.
Outputs
The weighted mean as a decimal, winsorized when method is set. The task fails with insufficient weight mass when the surviving mass is below minWeightMass.