← The Protocol Lab — all BIOVIA Pipeline Pilot guides
Running & Automating Protocols
Scheduled, triggered and API-driven — taking Pipeline Pilot beyond the desktop.
A protocol that someone has to manually click to run is only half a solution. The real operational value of Pipeline Pilot comes from running protocols automatically — on a schedule, triggered by an event, called from another system via API, or launched from the command line. This is how I turned one-time analysis into 24×7 operational pipelines processing millions of records a day in support of regulated (GMP) manufacturing.
Four ways to run a protocol outside the client
Each method has a specific use case. Understand all four before you design an automation strategy:
- Built-in Scheduler — set up recurring runs (daily, hourly, every N minutes) directly in the protocol's scheduling settings in the client. Best for simple time-based automation with no external trigger needed.
- Command Line — use the PilotScript.exe CLI to launch protocols from Windows Task Scheduler, batch files or CI/CD pipelines. Best when you need OS-level scheduling, parameterized ad-hoc runs, or integration with other shell scripts.
- REST API (Web Services) — Pipeline Pilot exposes a REST layer. Any system that can make an HTTP call (Python, Java, Power Automate) can trigger a protocol run, pass parameters and retrieve results. Best for event-driven automation.
- Protocol-to-Protocol — use the 'Run Protocol' component inside one protocol to trigger another. Best for orchestrating multi-step workflows where you want each stage independently managed and validated.
Built-in Scheduler → Command Line → REST API → Protocol-to-Protocol
Using the built-in Scheduler
- In the Protocol Client, right-click the protocol you want to schedule → Schedule Protocol. The scheduling dialog opens.
- Set the frequency: once, daily, weekly, monthly, or a custom interval in minutes. For overnight data loads I use daily at 2AM — off-peak and complete well before the morning shift.
- Set an optional end date. For indefinite production schedules, leave this blank.
- Pre-fill the runtime parameters. These are the same parameters your Web Port form shows — you hard-code them here for the scheduled run (e.g. RunDate = TODAY, SiteCode = ALL).
- Set Run As to a service account, never a personal account. Personal accounts get deactivated when someone leaves — and the schedule silently dies with them.
- Enable email notification on failure and point it to a distribution list. Silent overnight failures discovered at 8AM when the report is missing are the worst kind.
Command-line execution
The PilotScript CLI (installed with the Pipeline Pilot client) lets you trigger protocols from any shell, Task Scheduler or CI/CD pipeline:
:: Windows batch file — trigger a protocol with parameters
:: Used in Windows Task Scheduler or a CI/CD step
PilotScript.exe ^
-server "pp-server.company.com" ^
-user "svc_pipeline" ^
-password "%PP_SERVICE_PWD%" ^
-protocol "REMS/ETL/DailyExtract" ^
-param "RunDate=2024-01-15" ^
-param "SiteCode=PFZ-PA" ^
-param "OutputPath=C:\Reports\REMS\" ^
-wait ^
-logfile "C:\Logs\REMS_extract_%DATE%.log"
:: Check exit code — 0 = success, non-zero = failure
IF %ERRORLEVEL% NEQ 0 (
echo PROTOCOL FAILED — check log for details
exit /b 1
)
echo Protocol completed successfullyREST API — triggering protocols from external systems
Pipeline Pilot's Web Services layer exposes your protocols as REST endpoints. Any upstream system can trigger a run, pass parameters and retrieve results:
# Python — trigger a Pipeline Pilot protocol via REST API
import requests
PP_SERVER = "https://pp-server.company.com"
PROTOCOL_URI = "REMS/ETL/DailyExtract"
def run_protocol(run_date: str, site_code: str) -> dict:
"""Trigger a Pipeline Pilot protocol and return the results."""
url = f"{PP_SERVER}/pipeline/rest/run/{PROTOCOL_URI}"
payload = {
"RunDate": run_date,
"SiteCode": site_code,
"OutputFormat": "JSON"
}
response = requests.post(
url,
json=payload,
auth=("svc_pipeline", "your_password"), # or Bearer token
timeout=300 # 5-minute timeout for long-running protocols
)
response.raise_for_status()
return response.json()
# Usage
result = run_protocol("2024-01-15", "PFZ-PA")
print(f"Records processed : {result.get('RecordCount')}")
print(f"Status : {result.get('Status')}")
print(f"Output file : {result.get('OutputPath')}")Error handling in automated pipelines
Automation without error handling is a delayed disaster. Every automated protocol I deploy at Pfizer includes these safeguards:
- Pre-flight checks — at the start of every scheduled protocol, validate that data sources are reachable, input files exist, and today's data has not already been loaded (idempotency check). Fast-fail early rather than running halfway and failing expensively.
- Record count reconciliation — compare records read from the source against records written to the destination. If you read 1,000 and wrote 997, something silently failed. Log the discrepancy and alert.
- SMTP alerting on failure — every automated protocol emails an operations distribution list when it fails. Include the protocol name, run timestamp, error message and last successful run date.
- Retry logic for transient failures — network blips and connection timeouts are transient. A wrapper script that re-runs the protocol 2–3 times with a 5-minute delay catches most of these before escalating.
- Dead letter records — records that fail processing go to a separate database table or file for human review. Never silently discard failed records in an automated, regulated pipeline.
Tip: In GxP (regulated 'good practice') environments, automated protocols need to be treated like validated systems. Define the expected run time, expected record counts and acceptable count variance in your validation documentation. The engineer paged at 2AM should not be making on-the-spot decisions about whether a count discrepancy is acceptable — that boundary needs to be defined in advance.