Workflow chains
AuraScore 83/100

Clinical Trial Safety Event Triage Automation Specification

Design an automated multi-step workflow chain for ingesting, parsing, classifying, and escalating clinical trial adverse events under strict compliance timelines.

Use this specification when building or modernizing pharmacovigilance workflow chains that route adverse events from study sites to safety monitoring committees. It standardizes agent handoffs, regulatory validation rules, and clinician-in-the-loop triggers.

Template

Role: Senior Clinical Informatics Architect specialising in pharmacovigilance workflow engineering.

Context

  • Target Study Protocol: {{trial_protocol_id}}
  • Raw Ingestion Source: {{source_safety_data}}
  • Statutory Notification Window: {{regulatory_reporting_window}}
  • Tiered Review Matrix: {{escalation_tier_matrix}}
  • Clinical Interoperability Framework: {{ehr_integration_standard}}
  • Immutable Audit Store: {{audit_trail_system}}

Task

Author an end-to-end technical specification for a multi-agent workflow chain that ingests raw safety signals from {{source_safety_data}}, reconciles them against {{trial_protocol_id}}, computes causal risk tiers, and triggers human sign-offs compliant with {{regulatory_reporting_window}}.

Method

  1. Define the ingestion agent parameters that ingest raw unstructured event streams from {{source_safety_data}} using {{ehr_integration_standard}} data schemas.
  2. Construct the entity extraction chain step to isolate MedDRA terms, dosage histories, and timeline offsets.
  3. Model the conditional decision logic that checks extracted entities against criteria defined in {{escalation_tier_matrix}}.
  4. Specify deterministic fallback pathways for edge cases where certainty scores fall below protocol confidence thresholds.
  5. Map the programmatic handoff to the medical review committee, establishing countdown timers tied directly to {{regulatory_reporting_window}}.
  6. Detail the transaction logging mechanism that writes step-level states to {{audit_trail_system}} for 21 CFR Part 11 auditability.
  7. Formulate failure recovery, message retries, and data dead-letter queue routing for interrupted execution states.

Constraints

  • MUST maintain strict alignment with 21 CFR Part 11 and GCP guidelines throughout state transitions.
  • MUST NOT permit any automated downstream filing without explicit human-in-the-loop medical monitor sign-off.
  • Every agent handoff contract must include schema validation and payload hash verification.
  • Execution latency per pipeline node must be explicitly budgeted within the specification.

Output format

Provide the specification in four structured markdown sections:

  1. Pipeline Topology: Node diagram (ASCII or Mermaid) and step-by-step state machine definition.
  2. Agent Contracts: Input, output, error schemas, and validation rules for each node.
  3. Escalation & Human Review Protocol: Clear threshold tables mapping scores to actions.
  4. Audit & Compliance Architecture: Data retention and verification procedures (under 500 words).

Self-review

  • Confirm every variable ({{trial_protocol_id}}, {{source_safety_data}}, {{regulatory_reporting_window}}, {{escalation_tier_matrix}}, {{ehr_integration_standard}}, {{audit_trail_system}}) is explicitly addressed.
  • Verify that human-in-the-loop checkpoints cannot be bypassed by automated routing logic.
  • Check that all regulatory reporting time constraints contain deterministic alert buffers.
AuraScore breakdown
83/100Provisional
Instruction clarity15/15 · Strong

Explicit role, a named task, and discrete steps the model can follow.

Context architecture12/12 · Strong

Background, inputs and variables the model needs before it starts.

Constraint engineering12/12 · Strong

Hard boundaries — what the model must and must not do.

Output specification6/14 · Thin

A named, field-level shape for the response.

Reasoning structure10/10 · Strong

Ordered work items that force analysis before an answer.

Model compatibility10/10 · Strong

Length and structure that travel across frontier models.

Token efficiency5/10 · Thin

Signal density — instruction weight without padding.

Reusability7/7 · Strong

Documented variables so the scaffold adapts to new inputs.

Robustness5/5 · Strong

Quality bar, assumptions and behaviour when inputs are thin.

Observed performance1/5 · Thin

How much real usage the template has behind it.

ai-agents
agents-workflows
healthcare-life-sciences
clinical-trials
pharmacovigilance
workflow-chains