Official Chainlink Initiators
Initiators are the entry points for ChainLink’s job
pipeline. When a job is created its initiators are explicitly declared.
ChainLink initially supports five initiator types: RunLog, Web, Cron, EthLog, and RunAt. When specifying an initiator, the
type value is case insensitive.
All initiators can be bounded in time by specifying the optional top level
endAt fields. No new job runs will be created before the
startAt, or after the
endAt if they are specified. The
endAt fields accept ISO8601 strings or Unix timestamps.
Cron initiator is a simple way to schedule recurring job runs, using standard cron syntax with an extra field for specifying second level granularity.
Cron takes one parameter,
schedule which is a cron like schedule string. The
schedule is follows standard cron syntax but prepends an additional first field to specify second level granularity of time. For example:
1 2 3 4 5 *
would run on second 1 of the 2nd minute of the 3rd hour, on the 4th of
May(4th day of the 5th month), regardless what day of the week it is(*).
To translate any traditional cron schedule to this cron schedule, simply prepend a
0 as the first parameter:
* * * * * to
0 * * * * *.
EthLog initiator creates an Ethereum log filter, and when any log comes in it is passed on as the input to the a new job run.
EthLog takes the same parameters as an Ethereum log filter.
RunAt initiator triggers a one off job run at the time specified.
RunAt takes one parameter,
time accepts a ISO8601 string or a Unix timestamp.
RunLog initiator is the easiest initiator to use
when integrating ChainLink with on-chain contracts. It works similarly
to EthLog, but adds some helpful glue in to stitch together the
off-chain job with the on-chain contracts.
RunLog job is created, ChainLink begins watching
the blockchain for any log events that include that job’s ID. If any of
the events that come back match the log event signature of the ChainLink
oracle contract, then the ChainLink node parses the data out of that
log and passes it into a new log run.
A new run created by a
RunLog is automatically given the parameters needed for an
EthTx task to report the run back to the contract that originally created the event log.
RunLog initiators take an optional
address parameter. The
address parameter is optional, and takes an Ethereum address. By adding the
parameter, you make the event filter of the RunLog initiator more
restrictive, only listening for events from that address, instead of any
Web initiator enables jobs to be triggered via web requests, specifically
/jobs/:jobID/runs. Requests coming in to create new job runs must be authenticated.
Web currently takes no parameters.