Creating a Node is easy - it's just an async function!
A Node function receives two parameters -
inputis either a
Record<string, any>or a
Record<string, string>that contains all API Keys that were passed into the Aigur Client instance. You can use them for your API calls.
The Node function must return a
Promise that resolves to the output of the Node (
Record<string, any> or a
Here is an example of a Node that greets its input:
You can use runtime schema validators/parsers such as Zod (opens in a new tab) to validate the input and output of your Node.