Video thumbnail

Flowgent

An AI agent built on n8n, which can interact with the Flow blockchain

Flowgent

Created At

Agentic Ethereum

Winner of

Flow - Best Flow Plugin to existing AI Agent Framework

Project Description

Everyone must be able to participate in building our Agentic Future! Regardless of the level of their technical skills.

The current implementation is a PoC, which allows users to interact with the AI agent via a chat UI and perform a limited set of on-chain operations. No Cadence knowldge is required to start interacting with the smart contracts.

It's designed as a quick start for anyone who wants to interact with the blockchain in an abstract way, and potentially extend it with custom logic using one of the 400+ integrations available in n8n.

Chain of Thought

When choosing the idea for the hackathon project, I decided to build a no-code tool because I love the idea of allowing more people with less technical skills to experiment and test their ideas without the need for expensive developer input.

While researching the capabilities of the Flow blockchain, I came across a concept called Flow Interaction Templates (FLIX). This is a standard developed for the Flow blockchain, which allows various FVM transactions and scripts to be explained in human-readable form in wallets and dApps

But then I thought that it could also be an unluckily overlooked opportunity for use in AI agents.

And that's how I ended up with this project. Basically, I used the FLIX concept in a novel way, which allowed me to quickly build a prototype of the AI agents, which can transform user input intents into blockchain actions using public library of pre-defined templates.

The best part of this approach is that the FLIX concept will continue to grow independently, as wallets and dApps are interested in better UX. And since the AI agent is based on these templates, it will automatically be extended with more features as more FLIXes are added to the public library.

Scaling potential

The FLIX concept is not unique. There's the Ledger's Clear Signing standard, which was created for the Ethereum for a similar purpose. And I think it's safe to assume that other blockchains will eventually adopt one of these or create their own standard with similar concepts.

The best part is that switching the AI agent to one of the template providers is a trivial task. It would also require custom n8n nodes to be able to communicate with different blockchains, but that's no big deal either.

The agent can be easily switched to run on Ethereum, other EVM or even non-EVM blockchains.

Demo

The following command examples have been tested and found to work:

  • List all available blockchain interactions.
  • List the first 30 registered tokens.
  • Register a new burnable token named XXX with a maximum amount of 1 million and a limit of 100 tokens per mint.
  • Mint 50 XXX tokens.
  • Burn 10 XXX tokens.
  • Transfer 10 XXX tokens to 0x...
  • Get XXX token balance for the address 0x...
  • Get all token balances for the address 0x...

How it's Made

The AI Agent framework is built using the following technical stack:

  • n8n - open source workflow automation tool
  • The Flow - L1 blockchain with FVM powered by Cadence DSL

The repository has the following structure:

  • /plugin - custom open source NPM package @majus/n8n-nodes-flow that allows to interact with The Flow blockchain from n8n workflows
  • /workflows - a network of custom n8n workflows that handle all the backend logic

The demo is available here. It works on the Flow testnet and doesn't require authentication. The test account address is 0xae491da231ebeebc and its private key is stored in the n8n secure credentials wallet.

Fork it!

The project is fully open source and ready for anyone to self-host.

To set up your own local copy, do the following

  1. Create your own self-hosted instance of n8n (see here for instructions).
  2. Install the community package for Flow interaction support: @majus/n8n-nodes-flow (see here for the guide).
  3. Import all workflows from the /workflows folder of this repository.
  4. Set the flow credentials in the "FLIX: Execute template" workflow.
  5. Set the OpenAI credentials in the "Flowgent" workflow (see here for instructions).

That's it! Once that's done, you should be able to test/activate the "Flowgent" workflow and start chatting with your own blockchain AI agent and potentially participate in building our Agentic Future!

background image mobile

Join the mailing list

Get the latest news and updates