Examples
Worked workflow patterns using the Chainlink node
1. Send a Cross-Chain Token Transfer, End to End
Build a CCIP message, check the fee, then hand off to the Ethereum ExecutionNode to actually send it.
- Chainlink node:
resource=router,operation=getFee, with yourreceiverAddress,tokenAmounts, anddestinationChainSelector— confirmfeeAmountis acceptable - Chainlink node:
resource=message,operation=build, same fields — getencodedMessageandextraArgsBytes - Ethereum node: contract-write step calling
ccipSend(destinationChainSelector, message)on the source chain's Router, using the previous step's output as the tuple argument, sendingfeeAmountasmsg.value(native fee) or approving it first (ERC-20 fee) - Capture the returned
messageIdfrom the transaction receipt for step 2 below
Why getFee before build: checking the fee first lets you branch (e.g. to an
insufficient-balance error path) before spending gas building and sending a message you can't afford.
2. Poll a Sent Message Until It Delivers
- Store the
messageIdfrom Example 1 somewhere the workflow can re-read it (a variable, a queued job). - On a schedule/retry loop: Chainlink node,
resource=message,operation=getStatus,messageId={{messageId}} - Condition node: branch on
executionState—SUCCESS→ continue;FAILURE→ go to Example 3; otherwise → wait and retry
Tip: Space polls a few minutes apart — cross-chain finality on CCIP is not instant, and
the
lane/getLatency operation (Example 4) can tell you roughly how long to expect.
3. Detect and Flag a Failed Delivery for Manual Execution
- Chainlink node:
resource=message,operation=checkManualExecutionRequired,messageId={{messageId}} - Condition node:
manualExecutionRequired == true - If true, route to an alert/notification branch for a human to investigate and manually re-execute via the CCIP Explorer — this node cannot submit the manual execution itself (see Roadmap).
4. Check Lane Health Before Sending
- Chainlink node:
resource=router,operation=isChainSupported,network={{sourceNetwork}},destinationChainSelector={{destSelector}}— guard against sending to an unsupported chain - Chainlink node:
resource=lane,operation=getLatency, same selectors — show the user an expected delivery time estimate - Chainlink node:
resource=lane,operation=getRiskManagementStatus,chainSelector={{destSelector}}— warn (don't necessarily block) if the status isn'tNORMAL
5. Convert a Chain Identifier Before Calling Another Node
A user picks a chain by its familiar native chain ID (e.g. 42161 for Arbitrum); a downstream
Chainlink operation needs the CCIP chain selector instead.
- Chainlink node:
resource=router,operation=convertChainSelector,nativeChainId={{userSelectedChainId}} - Pass the returned
chainSelectorinto any operation on this page that expects one.