How Datasource Blocks Work

Live Data, Every Run

Datasource blocks execute at run time — they query your external systems with the actual current data for each workflow run. Unlike static configuration, datasource blocks ensure that every proposal uses today's prices, every RFP response references the current project portfolio, and every quote reflects current inventory levels.

Each datasource block references a configured provider connection (set up once in Settings) and defines a query — which can be static or can include template variables populated from earlier workflow blocks.

Results from datasource blocks are structured JSON arrays or objects available to all downstream blocks — AI reasoning blocks, transform blocks, merge blocks, and proposal template fills.

Data Flow Example

📄

Document Analysis

Extracts: customer_name, material_list

CRM Query

Query: WHERE name = {{customer_name}}

📊

ERP Pricing Lookup

Query: prices for {{material_list}}

🔁

Merge Objects

Combine CRM data + pricing into context

Block Type

CRM Query Block

Query your CRM for account, contact, opportunity, or custom object records. The CRM query block uses your configured CRM provider connection and returns matching records as a JSON array. Results can be used to enrich AI context, pre-fill proposal templates, or drive conditional routing.

Salesforce Query Configuration

  • Object type: Standard objects (Account, Contact, Opportunity, Quote, Lead) or any custom object
  • Query mode: SOQL (full control) or Visual Filter (no-code field/operator/value filter builder)
  • Field selection: Select which fields to return — only return what you need to reduce payload size
  • Parameter injection: Reference earlier workflow fields in query filters using {{field_name}} syntax
  • Sort and limit: ORDER BY, LIMIT, and OFFSET for controlled result sets
  • Relationship traversal: Query related records (e.g., Opportunity with Account and Contact rollup)

Common Query Patterns

// Salesforce: find account by name
SELECT Id, Name, Industry,
  AnnualRevenue, PricingTier__c
FROM Account
WHERE Name LIKE '%{{customer_name}}%'
LIMIT 1

Output Example

[{
  "Id": "0015g00001XyzABC",
  "Name": "BuildCo Inc.",
  "Industry": "Construction",
  "AnnualRevenue": 45000000,
  "PricingTier__c": "Enterprise",
  "BillingCity": "Chicago",
  "BillingState": "IL"
}]

No-match handling. Configure what happens when the query returns zero records — fail the block (halts the workflow), continue with empty array, or route to a fallback path. For RFP workflows, "no CRM match" often routes to a new-customer path that creates a Salesforce lead as part of the workflow.

Block Type

ERP Pricing Lookup Block

The ERP pricing lookup block is specifically designed for the construction and manufacturing use case of querying a bill-of-materials or material list against your ERP's pricing engine. It accepts a list of material numbers and quantities, passes them to the ERP, and returns current prices, lead times, and availability — typically as a line-item enriched array.

Supported ERP Systems

  • SAP S/4HANA / SAP ECC: SD condition records via OData; optionally invoke custom pricing BAPIs for complex pricing logic
  • Oracle Fusion: Price list lookup via REST; supports customer-specific price lists
  • Microsoft Dynamics 365 F&O: Trade agreements and price list entities via OData
  • Custom ERP: Configure any REST endpoint that accepts a material list and returns pricing data

Input: Material List

The block accepts a material list array — typically output from an AI extraction block or a workbook line items array. Each item should include a material identifier (part number, material code, or ERP-internal ID) and an optional quantity for quantity-based pricing.

Output: Enriched Line Items

Returns the input array enriched with pricing fields: unit price, currency, discount tier, lead time days, and stock availability. The downstream merge block or proposal template can then use these enriched items directly.

// Input to ERP Pricing block
[
  { "material_no": "MAT-00142",
    "quantity": 24,
    "unit": "EA" },
  { "material_no": "MAT-00891",
    "quantity": 3,
    "unit": "SET" }
]

// Output from ERP Pricing block
[
  { "material_no": "MAT-00142",
    "quantity": 24,
    "unit_price": 142.50,
    "currency": "USD",
    "total_price": 3420.00,
    "lead_time_days": 5,
    "in_stock": true },
  { "material_no": "MAT-00891",
    "quantity": 3,
    "unit_price": 895.00,
    "currency": "USD",
    "total_price": 2685.00,
    "lead_time_days": 14,
    "in_stock": false }
]
Block Type

Spreadsheet Read Block

Read data from Excel (.xlsx) or Google Sheets and use it as structured data in your workflow. The spreadsheet block is especially useful for rate sheets, labor cost tables, historical bid data, and pricing matrices that are maintained by your team in Excel or Sheets rather than a formal ERP system.

Configuration

  • Source: Microsoft 365 / SharePoint (Excel), Google Drive (Sheets), S3/Azure/GCS (Excel file), or file URL
  • Sheet selection: By name, by index, or by a workflow field (dynamic sheet name)
  • Range: Full sheet, named range, or A1-notation range
  • Header row: Specify which row contains column headers — used to key the output JSON objects
  • Type inference: Auto-detect number, date, boolean, and text cell types
  • Filter rows: Optional server-side row filter to reduce payload before returning to the workflow

Output

Returns a JSON array where each row is an object keyed by the header row values. Numbers are returned as JSON numbers (not strings), dates as ISO 8601 strings, and empty cells as null.

Live vs. static. Every workflow run re-reads the spreadsheet at the time of execution — you always get current data. If your rate sheet is updated mid-month, the next workflow run automatically picks up the new rates without any configuration change. This is different from importing rates once into a static configuration.

Common Use Cases

  • Labor rate sheets maintained by HR — looked up per trade and region
  • Material markup matrices — project type × material category
  • Historical bid tabulation data — referenced for competitive pricing
  • Customer tier pricing overrides — maintained by sales ops
Block Type

SQL Query Block

Execute parameterized SQL queries against internal databases — PostgreSQL, MySQL, or SQL Server. The SQL query block uses a configured database connection (managed in RenderDraw Settings) and accepts a parameterized query where workflow data can be safely injected as query parameters (never string-concatenated — SQL injection prevention is enforced).

Configuration

  • Connection: Named database connection from Settings > Providers
  • Query: Parameterized SQL — use @param_name syntax for safe parameter injection
  • Parameter mapping: Map workflow data fields to query parameters
  • Result limit: Default 1000 rows; configurable up to 50,000
  • Timeout: Query timeout threshold — fail gracefully rather than holding the workflow indefinitely

Security

SQL query blocks use read-only database users in all RenderDraw-managed connections. If you bring your own database credentials, we strongly recommend using a read-only user scoped to the minimum tables needed. Write operations are not supported in SQL query blocks — use a REST API call block or a dedicated write integration instead.

-- Example: Historical project lookup
SELECT
  project_name,
  project_type,
  total_value,
  margin_pct,
  completion_date
FROM projects
WHERE customer_id = @customer_id
  AND project_type = @project_type
  AND completion_date >= @cutoff_date
ORDER BY total_value DESC
LIMIT 10

Internal data without an ERP. For companies without a full ERP system, the SQL query block against an internal PostgreSQL or MySQL database is the fastest path to bringing live pricing, inventory, and project history data into workflows — without needing a REST API layer first.

Block Type

REST API Call Block

The REST API call block makes an HTTP request to any external REST endpoint and returns the response body as workflow data. It is the generic integration block for any service that doesn't have a dedicated native block — custom pricing APIs, supply chain visibility platforms, internal microservices, partner data feeds.

Configuration

  • Method: GET, POST, PUT, PATCH, DELETE
  • URL: Static or template with workflow field injection via {{field_name}}
  • Headers: Static headers plus workflow-injected values (e.g., customer-specific auth tokens)
  • Body: JSON, form-urlencoded, or multipart — with workflow data injection
  • Authentication: Bearer token, API key header, Basic auth, or OAuth 2.0 client credentials
  • Response extraction: JSONPath expression to extract a sub-object from the response (e.g., $.data.items)
  • Error handling: Configure which HTTP status codes are treated as errors vs. empty results
  • Retry policy: Automatic retry on 429 (rate limit) and 5xx errors with exponential backoff
// REST API call configuration
{
  "method": "POST",
  "url": "https://pricing.internal.com
    /api/v2/quote",
  "headers": {
    "Content-Type": "application/json",
    "X-Customer-Tier": "{{crm.pricing_tier}}"
  },
  "body": {
    "materials": "{{extraction.materials}}",
    "project_type": "{{extraction.project_type}}",
    "requested_ship_date": "{{extraction.deadline}}"
  },
  "response_extract": "$.quote_items"
}

Pagination support. For REST APIs that paginate results, configure the REST API call block with cursor-based or offset-based pagination. The block automatically loops through pages and returns a single merged array — no Loop block required for paginated lookups.

Block Type

GraphQL Query Block

Execute GraphQL queries and mutations against any GraphQL endpoint. Useful for Shopify product catalog, GitHub project data, internal GraphQL APIs, or any backend that exposes a GraphQL interface.

Configuration

  • Endpoint URL: The GraphQL endpoint URL
  • Query / Mutation: Full GraphQL query or mutation document — supports multi-line with introspection-based syntax validation in the block editor
  • Variables: JSON variables object with workflow field injection via template syntax
  • Authentication: Bearer token, API key header, or OAuth 2.0
  • Response extraction: Select the path in the response data to return as the block output

Use Cases

  • Query Shopify product catalog for current SKU pricing and availability
  • Pull GitHub project issues and pull requests for software project proposals
  • Query internal GraphQL API for project management data
query ProductPricing(
  $skus: [String!]!
) {
  products(skus: $skus) {
    sku
    title
    pricing {
      price
      currency
      availableQuantity
      leadTimeDays
    }
  }
}

// Variables
{
  "skus": "{{extraction.sku_list}}"
}
Performance

Caching and Rate Limiting

Response Caching

Datasource blocks support optional response caching per block. When caching is enabled, a cache key is computed from the block configuration and injected parameter values. If a matching cache entry exists and is within the TTL, the cached result is returned instead of making a live request — reducing latency and external API call volume.

Caching is disabled by default — enable it for data that doesn't change often (ERP catalog prices, customer tier assignments) and leave it disabled for data that must always be live (inventory availability, real-time quote pricing).

Cache Configuration

  • TTL: Cache time-to-live in seconds, minutes, or hours
  • Cache key scope: Account-wide (shared across all workflow runs) or per-run (isolated per execution)
  • Manual invalidation: Clear cached values from the Settings > Cache panel

Rate Limit Handling

External APIs impose rate limits that can cause workflow failures during high-volume periods. RenderDraw's datasource blocks handle rate limits gracefully:

  • Automatic retry: On 429 Too Many Requests, the block retries with exponential backoff (default: 3 retries, 1s/2s/4s delays)
  • Rate limit accounting: RenderDraw tracks API call volume per provider connection and can queue requests to stay within configured limits
  • Concurrent run limits: Configure max concurrent workflow runs that can hit a given provider connection simultaneously — prevent a spike in workflow triggers from exhausting an API quota

Salesforce API governor limits. Salesforce enforces daily API call limits per org. For high-volume workflows, enable response caching for CRM query blocks and use Salesforce bulk APIs for batch operations. The RenderDraw Salesforce connector tracks usage and alerts you when approaching the daily limit.

Live Data in Every Proposal

Stop using yesterday's prices. Connect your ERP, CRM, and internal data sources to your workflows — every run pulls current data automatically.