Nerif Docs
  • Quickstart
  • Tutorials
    • Lottery Tutorial
      • Step 1. Configure your account
      • Step 2. Add a smart contract
      • Step 3. Create a new automation workflow
      • Step 4. Build your automation workflow
      • Step 5. Test workflow execution
    • Bridge Tutorial
      • Step 1. Configure your account
      • Step 2. Add smart contracts
      • Step 3. Create a new automation workflow
      • Step 4. Build your automation workflow
      • Step 5. Test workflow execution
    • Price Feed Tutorial
      • Step 1. Configure your account
      • Step 2. Add smart contract
      • Step 3. Create a new automation workflow
      • Step 4. Build your automation workflow
  • 1. What is Nerif Network?
    • Our Mission
    • Our Vision
    • Terms
  • 2. Architecture
    • Core components
    • Validators
      • Networking
        • Bootnode
        • Joining the network
        • Leaving the network
        • Slashing
      • Consensus
        • Epoch & Rounds
        • Automation workflow
          • Triggers
          • Actions
          • Condition
    • Contracts
      • System Contracts
      • Operational Contracts
    • Security
      • DKG
      • Threshold ECDSA
      • Security checks
  • 3. How it works
    • Introduction
    • Nerif App
    • Login
    • Account Configuration
      • 1. Deploy a Gateway Contract
        • 1.1 Create a new gateway
        • 1.2. Use existing gateway contract
        • 1.3.What if I want to update my gateway contract?
      • 2. Top up your balance
        • 2.1. Topping up your balance on Polygon Mumbai
        • 2.2. Topping up your balance on Ethereum Goerli
    • Fees
    • User balance
      • 1. Topping up the balance
        • 1.1 Top up your balance via Nerif App
        • 1.2 Top up your balance directly via Registry smart contract
      • 2. Withdraw from balance
        • 2.1 Withdraw via Nerif App
        • 2.2 Withdraw directly via Registry smart contract
    • API
      • Off-chain APIs
      • On-chain APIs
    • SDK
  • 5. Nerif DAO
    • Governance
    • Treasury
    • Proposal process
  • 6. Support
Powered by GitBook
On this page
  1. Tutorials
  2. Bridge Tutorial

Step 4. Build your automation workflow

PreviousStep 3. Create a new automation workflowNextStep 5. Test workflow execution

Last updated 1 year ago

First, we need to configure our event-based trigger.

To do so, select Ethereum Goerli as a chain to interact with and choose the contract we added previously in Step 2 from a drop-down list.

We also need to select an event that will be triggering an automation workflow, which is event Send.

When Send event is clicked in the Nerif App, it will display fields from the event such as chainID, target, payload, gasAmount, and sender.

This feature enhances our automation capabilities by allowing us to trigger workflows based on specific details within the emitted events. In this example, the automation workflow will only be triggered if the receiver's chain ID specified in the event is Polygon Mumbai.

Thus, we enter the chain ID for Polygon Mumbai into the field chainId, i.e. 80001, and click “Confirm”.

Assuming the recipient chain is Polygon Mumbai, we want the automation workflow to proceed further to receiving the data on the Polygon Mumbai chain.

To do that, we need to send a transaction to rec function within the NerifBridge contract deployed on the Polygon Mumbai chain.

To implement this, first, click “Add step” and select “Action”.

Assuming the recipient chain is Polygon Mumbai, we want the automation workflow to proceed further to receiving the data on the Polygon Mumbai chain. To that, we need to send a transaction to rec function within the NerifBridge contract deployed on the Polygon Mumbai chain. Thus, we choose “Transaction” as our action type.

Now, let’s add the needed details for the transaction, as per the example below. We specify the Polygon Mumbai chain, select the contract address in a drop-down list (Polygon NerifBridge that we added in Step 1), and set the gas limit.

After we put in all the transaction details, click “Confirm”.

Finally, we want the automation workflow to stop if the recipient’s chain ID is not Polygon Mumbai.

We'll do that by clicking “Add step” and selecting “Exit”.

Our final workflow will look as shown below.

At the end, click “Publish” in the top right corner and confirm the transaction in your wallet to publish your workflow within Nerif Network. After that, your automation workflow is all set, congrats!

We also need to specify the function from a drop-down list. Again, this part of the automation workflow will only happen if the sender’s chain ID is Polygon Mumbai.

rec