Firecrawl icon

Firecrawl

Scrape, crawl, map, search, and extract structured data from websites using Firecrawl API

Interact → Interact context

AI-generated

Overview

This node operation provides context and instructions for using the Firecrawl Interact API. It is designed to be called before any other Interact tools to set up the environment and guide the AI agent on how to interact with web pages through scraping, clicking, typing, and extracting dynamic content. It supports different interaction modes including natural language prompts and code execution in various languages (Node.js, Python, Bash). This operation is beneficial for workflows that require multi-step web interactions with persistent browser sessions, such as automated form filling, navigation, and data extraction from dynamic websites.

Use Case Examples

  1. Scrape a webpage and then use this node to provide context for interacting with the page, such as clicking buttons or extracting data.
  2. Use the node in Code mode with JavaScript to execute Playwright commands on a scraped page to automate complex interactions.
  3. Use the node in Prompt mode to instruct the AI agent in natural language to perform tasks like scrolling or clicking without writing code.

Properties

Name Meaning
Context Provides detailed instructions and rules for using the Firecrawl Interact API, including usage guidelines for different modes (Prompt, Code) and languages (Node, Python, Bash). This property is used to customize the instructions for the AI agent.
Use Custom Body Boolean flag to indicate whether to use a custom request body for the interaction context call.
Request Options Settings to control request behavior such as batching, SSL certificate validation, proxy usage, and timeout duration.

Output

JSON

  • data - The main response data from the Firecrawl Interact API after setting the interaction context.
  • metadata
    • scrapeId - Identifier for the scrape session used to maintain browser state across interactions.

Dependencies

  • Firecrawl API key credential

Troubleshooting

  • Ensure the Context property contains valid and clear instructions matching the selected Mode (Prompt or Code) to avoid syntax errors or empty responses.
  • In Node mode, always use `process.stdout.write()` instead of `console.log()` to output data, as the latter does not appear in the response.
  • Avoid re-declaring variables in consecutive code executions by using unique variable names or wrapping code in an IIFE to prevent syntax errors.
  • Make sure to call the Scrape tool first to obtain a valid `scrapeId` before using this interaction context node.
  • If using custom request options like proxy or ignoring SSL issues, verify the configurations to prevent connection errors.

Links

Discussion