How to Construct a Workflow
This guide will walk you through how to construct a KRNL Studio workflow that fetches real estate data, analyzes it with AI, and encodes the results for on-chain submission.
We’ll break it down step by step so you understand what each part of the workflow does, and then show you the final JSON config you’ll use.
⏱ Time to complete: ~15 minutes
What You’ll Build
A workflow that:
Fetches property data from Zillow (mocked API in this example)
Fetches market estimates (value, rent, etc.)
Runs an AI property analysis (GPT-based)
Encodes the results into an EVM transaction
Prepares it for blockchain submission with cryptographic proof
Step 1: Launch KRNL Studio
Open https://studio.krnl.xyz in your browser. You should see the KRNL Studio interface.
Step 2: Set Up Your Workflow Foundation
Create a New Workflow
Click "Start Building"
Name your workflow:
Real Estate Investment Analyzer
Select
Sepolia Testnet
as the Blockchain NetworkPaste the target contract address (deployed in Local Dev)
Next you will have option to fetch your ABI automatically from Etherscan or manually input the ABI
Finally you will have a canvas with pre-filled nodes

The canvas will display the default nodes:
Basic Info: Workflow metadata and configuration
dApp Config: Target contract settings
Workflow Steps: To add custom workflow steps
Configure Basic Information
Hover over Basic Info node and click on the settings
You might see all the fields already filled in
After verifying the fields, let's move on to the next node
Configure dApp Information
Hover over the dApp Config node and click on the settings
You might see all the fields already filled in
Again after verifying the fields, let's move on to the next node
Step 3: Add Workflow Steps
Add a Property Data Fetcher Step

Click on Add Node and drag and drop the HTTP GET under HTTP step into the workflows
Hover over the step and click on settings
First, let's name it
property-data-fetcher
(This name could be anything you like)
Configure the API Request
In the settings page, there is a section called Inputs, under this configure your API request
URL:
https://poc.platform.lat/zillow/webservice/GetSearchResults.htm?zws-id=demo-api-key&address=1234-Maple-Street&citystatezip=Austin,TX
Method:
GET
Set Outputs
zpid
→response.body.searchResults.zpid
address.street
→response.body.searchResults.address.street
address.city
→response.body.searchResults.address.city
address.state
→response.body.searchResults.address.state
address.zipcode
→response.body.searchResults.address.zipcode
Close the Settings.
Add a Market Data Fetcher Step
Click on Add Node and drag and drop the HTTP GET under HTTP step into the workflows
Hover over the step and click on settings
First, let's name it
market-data-fetcher
(This name could be anything you like)
Configure the API Request
URL:
https://poc.platform.lat/zillow/webservice/GetZestimate.htm?zws-id=demo-api-key&zpid=${property-data-fetcher.zpid}
Method:
GET
Set Outputs
zestimate.amount.value
→response.body.zestimate.amount.value
zestimate.amount.currency
→response.body.zestimate.amount.currency
zestimate.rent.value
→response.body.zestimate.rentZestimate.value
zestimate.rent.currency
→response.body.zestimate.rentZestimate.currency
property.bedrooms
→response.body.property.bedrooms
property.bathrooms
→response.body.property.bathrooms
property.finishedSqFt
→response.body.property.finishedSqFt
property.yearBuilt
→response.body.property.yearBuilt
property.type
→response.body.property.propertyType
Close the Settings.
Output type should be string for all the outputs
Add an AI Node
Click on Add Node and drag and drop the OpenAI GPT under AI Assistant step into the workflows
Hover over the step and click on settings
First, let's name it
ai-property-analysis
(This name could be anything you like)
Configure the AI Request
URL:
https://api.openai.com/v1/chat/completions
Method:
POST
Headers:
{ "Accept": "application/json", "Content-Type": "application/json", "Authorization": "Bearer ${_SECRETS.OPENAI_API_KEY}" }
Body:
{ "model": "gpt-4o-mini", "temperature": 0, "response_format": { "type": "json_object" }, "messages": [ { "role": "system", "content": "You are a professional real estate analyst. Only output valid JSON." }, { "role": "user", "content": "Analyze this property for investment potential. Property: ${property-data-fetcher.address.street}, ${property-data-fetcher.address.city}, ${property-data-fetcher.address.state} ${property-data-fetcher.address.zipcode}. Bedrooms: ${market-data-fetcher.property.bedrooms}, Bathrooms: ${market-data-fetcher.property.bathrooms}, SqFt: ${market-data-fetcher.property.finishedSqFt}, Year Built: ${market-data-fetcher.property.yearBuilt}, Type: ${market-data-fetcher.property.type}. Zillow Estimate: ${market-data-fetcher.zestimate.amount.value}(${market-data-fetcher.zestimate.amount.currency}). Rent: ${market-data-fetcher.zestimate.rent.value}(${market-data-fetcher.zestimate.rent.currency}). Return JSON: { recommendation: INVEST/HOLD/PASS, property_value: number*10^20, investment_grade: A+/A/B+/B/C+/C/D, expected_annual_yield: number*10^18, confidence: number (1-100), invest_value: number * 10^18 }." } ] }
Set Outputs
ai_analysis.result
→response.body.choices.0.message.content
Close the Settings.
Step 4: Construct & Submit EVM Payload
This node will be automatically added as soon as you add the first step in the workflow. Now click on edit to open the settings
Configure Parameters -> Expected Response in the contract
Under the settings we need to first configure the response fields which are expected by the target smart contract, in our case,
confidence -> uint256
expectedAnnualYield -> uint256
investmentGrade -> string
propertyValue -> uint256
recommendation -> string
Map Parameters -> Expected Response in the contract
As we have configured the field as components under Configuration in the Settings. Now we can map the workflow results to the fields as per the requirement, in our case this is how the mapping should look like where each field is being mapped via internal referencing of selective workflow steps.
propertyInfo: {
confidence: "${ai-property-analysis.result.confidence}",
expectedAnnualYield: "${ai-property-analysis.result.expected_annual_yield}",
investmentGrade: "${ai-property-analysis.result.investment_grade}",
propertyValue: "70000000000000000000000",
recommendation: "${ai-property-analysis.result.recommendation}"
}
Set Outputs
No change needed
Close the Settings.
Step 5: Preview, Save, and Export
Verify all connections
Check node outputs
Save workflow (auto-save enabled)
Export workflow: Workflow Name → Export → Download JSON
Last updated