New to Kestra?
Use blueprints to kickstart your first workflows.
Run synthetic web page health checks with headless Playwright. Validate page titles, capture screenshots, and fire Slack alerts on failure.
Diagram unavailable
We could not build the topology for this blueprint. The flow itself is valid, use the YAML on the left to run it.
Automate real end-to-end browser health monitoring directly inside Kestra using headless Playwright. While standard HTTP pingers only verify basic network connectivity, this blueprint connects to a Playwright server, renders full web pages, executes declarative title assertions, captures a page screenshot, and routes structured alerts to Slack. It provides automated synthetic testing for critical web paths without needing custom browser automation scripts or third-party SaaS services.
daily_synthetic_check (io.kestra.plugin.core.trigger.Schedule, disabled by default) runs the workflow on a configured schedule or on demand.check_page_health (io.kestra.plugin.playwright.Check) connects to a remote Playwright WebSocket server (PLAYWRIGHT_SERVER_URL), sets actionTimeout: PT{{ inputs.timeout_seconds }}S, navigates to target_url, asserts that the page title matches expected_title, and captures a full-page screenshot (page_health.png). The task sets allowFailed: true so assertion or timeout failures can be evaluated downstream without crashing the execution. A page that does not finish navigation and title assertion within timeout_seconds fails the check.classify_outcome (io.kestra.plugin.core.debug.Return) evaluates the browser task output and returns a single-line outcome string (PASS or CHECK_FAILED).route_outcome (io.kestra.plugin.core.flow.Switch) routes execution based on the classified outcome:PASS, log_success (io.kestra.plugin.core.log.Log) records a success message.CHECK_FAILED, alert_check_failed (io.kestra.plugin.slack.notifications.SlackIncomingWebhook) dispatches a plain-text JSON alert to Slack.defaults branch handles unclassified outcomes gracefully.errors block dispatches a Slack alert if an unexpected infrastructure error occurs during flow execution.{{ outputs.check_page_health.screenshots["page_health.png"] }}).PASS or CHECK_FAILED) with modular Switch routing.Standalone browser scripts lack durable state management, structured task retries, and centralized observability. Kestra turns Playwright checks into first-class observable workflows with execution history, captured artifacts, visual topology graphs, and automated Slack alerting. By combining declarative YAML actions with flow control, Kestra makes synthetic web testing reproducible, version-controlled, and observable across all environments.
mcr.microsoft.com/playwright:v1.63.0-noble started with command:
docker run -d --name playwright -p 3000:3000 mcr.microsoft.com/playwright:v1.63.0-noble npx -y playwright@1.63.0 run-server --port 3000 --host 0.0.0.0PLAYWRIGHT_SERVER_URL to point to the Playwright WebSocket server (e.g. ws://playwright:3000).PLAYWRIGHT_SERVER_URL: ws:// or wss:// endpoint of the Playwright WebSocket server (e.g. ws://playwright:3000).SLACK_WEBHOOK_URL: Slack Incoming Webhook URL for alerting.Note for Open Source Edition (OSS): Secrets can be set as base64-encoded environment variables on the Kestra worker: export SECRET_PLAYWRIGHT_SERVER_URL=$(echo -n "ws://playwright:3000" | base64) export SECRET_SLACK_WEBHOOK_URL=$(echo -n "https://hooks.slack.com/services/YOUR/WEBHOOK/URL" | base64)
target_url (STRING, default https://example.com): Target URL to probe.expected_title (STRING, default Example Domain): Expected page title.timeout_seconds (SELECT, default "10", options: "5", "10", "30"): Maximum time in seconds allowed for page navigation and title assertion.{{ outputs.check_page_health.screenshots["page_health.png"] }}: URI of the full-page screenshot stored in Kestra internal storage.{{ outputs.classify_outcome.value }}: Classified health outcome string (PASS or CHECK_FAILED).PLAYWRIGHT_SERVER_URL and SLACK_WEBHOOK_URL in Kestra secrets.company.team).target_url: https://example.com and expected_title: Example Domain to verify a successful check.expected_title: NonExistentTitle.daily_synthetic_check trigger for automated recurring monitoring.FILL and CLICK actions prior to page title assertion.ASSERT_VISIBLE and ASSERT_TEXT actions to validate complex UI components.SCREENSHOT actions.timeout_seconds fail the check.https://example.com) is a third-party domain used for demonstration purposes.