Module 9a: How to use Functions
Step 1
Head over to the Functions workflow
Step 2
Create your PROMPT Function:
create a basic fetch call for the weather of any location
create a serper
You can find more examples here
A basic Weather API call (link here)
async ({ lat, long }) => {
// Use Open-Meteo's public API for fetching weather data
let url = `https://api.open-meteo.com/v1/forecast?latitude=${lat}&longitude=${long}¤t_weather=true`;
let response = await fetch(url);
let data = await response.json();
return { weather: data.current_weather };
};An API call for Serper - a service for google search (link here)
Step 3
Hit Submit, if your code is working fine you will get your outputs on the right side. Use the “Save as New” button and update the run name.
Step 4
Now head over to the Gooey workflow where you want to add the saved functions.
Head over to the example below:
Check the Functions option, and choose “PROMPT” from the dropdown and add your Saved example. And then hit "SUBMIT!

You can check your Functions output in the Workflow at the end of the page in "Details" section.


PreviousModule 9: Agentic LLMs, Functions and Developer ToolsNextModule 9b: Adding Functions for Value-Adds
Last updated
Was this helpful?