Skip to content

API Reference parrot_tools.scraping.flow_executor

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot_tools.scraping.flow_executor

View source

FlowExecutor — orchestration engine for ScrapingFlow execution.

Ties together the FEAT-222 layers: topological ordering (:class:ScrapingFlow), template binding (:class:TemplatePlan), session/page management (:class:SessionManager + :class:PageDriver), per-node execution (execute_plan_steps), data-dependency input resolution, fan-out, per-node error policies, and checkpoint persistence/resumption (FEAT-222, Module 8).

Alias BasePlanRegistry

Re-exported from parrot_tools.scraping.base_registry.BasePlanRegistry.

Alias CredentialResolverFn

Re-exported from parrot_tools.scraping.session_actions.CredentialResolverFn.

Alias DriverConfig

Re-exported from parrot_tools.scraping.toolkit_models.DriverConfig.

Class FlowExecutor

Orchestrate end-to-end execution of a :class:ScrapingFlow.

Parameter Type Default Description
browser Any A live Playwright Browser instance.
registry Optional[BasePlanRegistry] None Optional plan registry used to resolve plan_ref values that are stored ScrapingPlan names/fingerprints.
config Optional[DriverConfig] None Driver configuration forwarded to execute_plan_steps.
concurrency int 1 Maximum concurrent fan-out executions.
checkpoint_dir Optional[Path] None Directory for per-flow checkpoint files. When None, checkpointing/resume are disabled.
logger Optional[logging.Logger] None Optional logger.
templates Optional[Dict[str, TemplatePlan]] None Optional mapping of template_name -> TemplatePlan used to resolve and bind plan_ref values. (The dedicated TemplatePlanRegistry is deferred per the spec; this mapping is the template source in the meantime.)
credential_resolver Optional[CredentialResolverFn] None Optional resolver forwarded to every executed node's authenticate steps (code-review remediation, FEAT-453 AC-5) — without this, a credential_provider-backed Authenticate always fails closed even when the caller (e.g. BusinessAutomationToolkit) was constructed with a CredentialBroker, since execute_plan_steps previously had no way to receive one.
channel Optional['HumanChannel'] None Optional :class:HumanChannel forwarded to every executed node's await_human steps, so a mid-plan pause actually reaches a person instead of always resolving channel=None.

Method FlowExecutor.run

Execute flow end-to-end and return an aggregated :class:FlowResult.

run(flow: ScrapingFlow, params: Optional[Dict[str, Any]] = None, resume_from: Optional[str] = None) -> FlowResult

Parameter Type Default Description
flow ScrapingFlow The flow to execute.
params Optional[Dict[str, Any]] None Extra global parameters merged with flow.global_params and passed to template binding.
resume_from Optional[str] None If set, nodes before this node id are loaded from the checkpoint (treated as already completed) and execution begins at resume_from.

Returns: FlowResult — A FlowResult with per-node results and run metadata.

Alias FlowNode

Re-exported from parrot_tools.scraping.flow_models.FlowNode.

Alias FlowResult

Re-exported from parrot_tools.scraping.flow_models.FlowResult.

Alias PageDriver

Re-exported from parrot_tools.scraping.drivers.page_driver.PageDriver.

Alias ScrapingFlow

Re-exported from parrot_tools.scraping.flow_models.ScrapingFlow.

Alias ScrapingPlan

Re-exported from parrot_tools.scraping.plan.ScrapingPlan.

Alias ScrapingResult

Re-exported from parrot_tools.scraping.models.ScrapingResult.

Alias SessionManager

Re-exported from parrot_tools.scraping.session_manager.SessionManager.

Alias TemplatePlan

Re-exported from parrot_tools.scraping.template_plan.TemplatePlan.

Alias execute_plan_steps

Re-exported from parrot_tools.scraping.executor.execute_plan_steps.

Alias load_plan_from_disk

Re-exported from parrot_tools.scraping.plan_io.load_plan_from_disk.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally