For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Dashboard
User GuideDeveloper GuidesAPI Reference
User GuideDeveloper GuidesAPI Reference
  • Getting Started
    • What is Runtype?
    • Creating your account
    • Platform Keys vs. BYOK
    • Understanding the Runtype UI
    • Quickstart: Social Media Post Generator
    • Quickstart: From Agent to Chat Widget
  • Dashboard
    • What is the Dashboard?
    • Daily Executions
  • Playground
    • What is the Playground?
  • Products & Surfaces
    • What are Products?
    • What are Surfaces?
    • Creating a Product
    • Setting up a Chat Surface
    • Setting up an API Surface
    • Setting up an MCP Surface
    • Setting up an A2A Surface
    • Setting up a Slack Surface
    • MCP authentication
    • Authenticating with product API keys
    • Embedding the chat widget (script tag)
    • Embedding the chat widget (React)
    • Surface orchestration modes
    • Product views
    • Adding Capabilities to a product
    • Connecting external agents
    • How A2A works
    • Connecting to Cursor / VS Code
    • Connecting to Claude Desktop
    • Scoping API keys to capabilities
    • Auto-generated OpenAPI spec
    • Calling your API endpoints
    • Client tokens and domain restrictions
    • AI-powered theme generation
    • Widget theming and customization
    • Product versioning and status
  • Flows
    • What are Flows?
    • Creating and Editing Flows
    • Flow step types overview
    • Agent and Flow Templates
    • Using prompt steps
    • Using transform-data steps
    • Using conditional steps
    • Using fetch-url and api-call steps
    • Using record steps (upsert/retrieve)
    • Flow variables and templates
    • Flow versioning and publishing
    • Running flows in batch
    • Handling batch failures
    • Debugging flows
  • Agents
    • What are Agents?
    • Creating and configuring Agents
    • Agent tools
  • Records
    • What are Records?
    • Creating and managing records
    • Using records in flows
    • Filtering and searching records
  • Tools
    • What are Tools?
    • Built-in Tools
    • Creating custom tools
    • Creating external tools
    • Runtime tools
  • Evals
    • What are Evals?
    • Running an Eval
    • Interpreting eval results
  • Schedules
    • What are Schedules?
    • Automating batch processing
  • Logs
    • What are Logs?
    • Working with Logs
  • Integrations
    • Connecting AI model providers
    • Slack integration
    • Google Workspace integration
    • GitHub integration
    • Linear integration
    • Weaviate (vector search)
    • Firecrawl (web scraping)
    • Exa (web search)
  • Settings
    • What's in Settings?
    • Available AI models
    • What are Organizations?
    • Managing AI models
    • Managing API keys
    • Billing and plans
    • Usage data
    • Team members and permissions
    • Appearance and preferences
    • Integrations (PostHog, Weaviate, Daytona)
  • Troubleshooting & FAQ
    • FAQ
    • Rate Limits and Usage
    • Managing Runtype with Claude
    • Flow execution failures
    • Common errors and solutions
    • Authentication issues
Dashboard
LogoLogo
On this page
  • What are Records?
  • Retrieve Record step
  • Add a retrieve step
  • Accessing retrieved data
  • Upsert Record step
  • Add an upsert step
  • Source variable
  • Vector Search step
  • Add a vector search step
  • Accessing search results
  • RAG pattern
  • Error handling
  • Best practices
  • Next steps
Flows

Using record steps (upsert/retrieve)

Was this page helpful?
Previous

Flow variables and templates

Next
Built with

Record steps let Flows interact with Runtype’s Record store to retrieve data, save results, or search for relevant information.

What are Records?

Records are structured data entries with JSON metadata. Use them to store customer data, knowledge bases, Product catalogs, or any information your Flows need to reference.

See What are Records? for a full overview.

Retrieve Record step

Fetch a specific Record by ID or unique field.

Add a retrieve step

  1. Click Add Step
  2. Select Retrieve Record
  3. Configure:
    • Name: Descriptive label (e.g., “Get customer data”)
    • Record type: Select the Record collection
    • Lookup field: Field to match (e.g., id, email)
    • Lookup value: Value to search for (e.g., {{customerId}})
  4. Click Save Step

The step returns the matching Record or null if not found.

Accessing retrieved data

Reference the step’s outputVariable name directly:

{{customer_data.metadata.customerName}}
{{customer_data.metadata.tier}}
{{customer_data.id}}

Upsert Record step

Create a new Record or update an existing one.

Add an upsert step

  1. Click Add Step
  2. Select Upsert Record
  3. Configure:
    • Name: Descriptive label (e.g., “Save conversation”)
    • Record type: Select the Record collection
    • Source Variable: The outputVariable name from a prior step that contains a JSON object
    • Record Name: Optional name to match for updates
  4. Click Save Step

Source variable

The sourceVariable must point to a JSON object from a previous step. For example, if a prompt step outputs JSON to analysis_result, use analysis_result as the source variable.

1{
2 "customerId": "{{customerId}}",
3 "conversationSummary": "{{summarize_result}}",
4 "sentiment": "{{analyze_sentiment.label}}",
5 "timestamp": "{{_now.iso}}"
6}

If the unique field matches an existing Record, it is updated. Otherwise, a new Record is created.

Important: The sourceVariable must reference a JSON object, not a plain text string. If using a prompt step to produce the data, set responseFormat to json.

Vector Search step

Find Records by semantic similarity using vector embeddings. This works with your connected vector store (Weaviate, Pinecone, pgvector, or Cloudflare Vectorize).

Add a vector search step

  1. Click Add Step
  2. Select Vector Search
  3. Configure:
    • Name: Descriptive label
    • Query: The text to search for
    • Vector store: Select your connected store
    • Output Variable: Name for the results
  4. Click Save Step

Accessing search results

Vector search returns an array of matching Records:

{{search_results[0].metadata.answer}}
{{search_results[1].metadata.content}}

RAG pattern

Common workflow for question answering with Records:

  1. Retrieve Record or Vector Search: Find relevant documents for the user question
  2. Transform Data: Extract and format retrieved context
  3. Prompt: Generate answer using retrieved context

Example prompt:

Answer this question using only the provided context.
Question: {{question}}
Context:
{{search_results[0].metadata.content}}
{{search_results[1].metadata.content}}
Answer:

For semantic search, Records must have embeddings. Use the Generate Embedding and Store Vector steps to index content.

Error handling

Handle missing Records:

Conditional: {{customer_data}} != null
If true: Use Record data
Else: Handle missing Record (default values, error message, etc.)

Best practices

  • Index frequently searched fields: Improves query performance
  • Keep metadata concise: Only store data you’ll actually use
  • Use unique fields for upserts: Prevents duplicate Records
  • Limit search results: Don’t retrieve more Records than needed

Next steps

  • What are Records? for detailed Record concepts
  • Creating and managing records to populate your Record store
  • Using records in flows for more advanced patterns
  • Using prompt steps to generate answers from retrieved context