AGENCYSCRIPT
CoursesEnterpriseBlog
๐Ÿ‘‘FoundersSign inJoin Waitlist
AGENCYSCRIPT

Governed Certification Framework

The operating system for AI-enabled agency building. Certify judgment under constraint. Standards over scale. Governance over shortcuts.

Stay informed

Governance updates, certification insights, and industry standards.

Products

  • Platform
  • Certification
  • Launch Program
  • Vault
  • The Book

Certification

  • Foundation (AS-F)
  • Operator (AS-O)
  • Architect (AS-A)
  • Principal (AS-P)

Resources

  • Blog
  • Verify Credential
  • Enterprise
  • Partners
  • Pricing

Company

  • About
  • Contact
  • Careers
  • Press
ยฉ 2026 Agency Script, Inc.ยท
Privacy PolicyTerms of ServiceCertification AgreementSecurity

Standards over scale. Judgment over volume. Governance over shortcuts.

On This Page

What an AI Workflow Orchestration Engine DoesOrchestration Engine SelectionApache AirflowDagsterPrefectKubeflow PipelinesWorkflow Architecture PatternsPattern 1: Extract-Transform-Train-Deploy (ETTD)Pattern 2: Feature PipelinePattern 3: Monitoring and Retraining LoopPattern 4: Multi-Model EnsembleWorkflow Orchestration Anti-PatternsOrchestration for Real-Time AI SystemsScaling Orchestration Across the OrganizationCost Management for Orchestrated PipelinesDelivery ProcessPhase 1: Pipeline Discovery and Design (Weeks 1-3)Phase 2: Infrastructure Build (Weeks 4-7)Phase 3: Pipeline Migration (Weeks 8-14)Phase 4: Optimization and Standardization (Weeks 15-18)Measuring Orchestration SuccessPricing Workflow Orchestration EngagementsYour Next Step
Home/Blog/23 Pipeline Steps Held Together by Cron Jobs and Shell Scripts
Delivery

23 Pipeline Steps Held Together by Cron Jobs and Shell Scripts

A

Agency Script Editorial

Editorial Team

ยทMarch 21, 2026ยท13 min read
ai workflow orchestrationpipeline automationmlops deliveryai infrastructure

A healthcare analytics company had a patient risk prediction pipeline that involved 23 steps: extract data from four source systems, validate quality, compute 47 features, run three models in sequence (because the output of one was an input to the next), apply business rules, validate predictions, write results to two downstream systems, and send alerts for high-risk patients. The pipeline was orchestrated by a series of cron jobs, shell scripts, and Python scripts that one engineer understood. When that engineer went on vacation and the pipeline broke at step 14 on a Saturday morning, nobody knew how to fix it. Patient risk alerts were delayed by 38 hours. When an AI agency rebuilt the pipeline on a proper workflow orchestration engine, the entire pipeline became visible in a single dashboard. Every step had monitoring, alerting, and automatic retry logic. Failure at any step triggered an alert with context about what failed and why. The on-call engineer could restart from the failed step rather than re-running the entire 4-hour pipeline. Mean time to recovery for pipeline failures dropped from 8 hours to 22 minutes.

What an AI Workflow Orchestration Engine Does

An AI workflow orchestration engine manages the execution of complex, multi-step AI pipelines. It defines the sequence and dependencies between steps, executes each step on appropriate compute infrastructure, handles failures and retries, provides visibility into pipeline status, and maintains a complete audit trail.

Core problems it solves:

Dependency management. AI pipelines have complex dependencies โ€” feature computation depends on data extraction, model inference depends on feature computation, post-processing depends on inference. The orchestrator ensures steps execute in the correct order and handles cases where dependencies fail.

Error handling and recovery. When a step fails (and in production, steps fail regularly), the orchestrator provides retry logic, failure alerting, and the ability to restart from the failed step rather than re-running the entire pipeline.

Scheduling and triggering. Pipelines need to run on schedules (hourly, daily), on events (new data arrived, model updated), or on demand (ad hoc retraining request). The orchestrator manages all trigger types.

Resource management. Different pipeline steps need different compute resources โ€” data processing needs large memory instances, model training needs GPUs, inference needs low-latency endpoints. The orchestrator provisions the right resources for each step.

Observability. The orchestrator provides a single place to see the status of every pipeline, every step, every run. It tracks execution time, success rate, and resource consumption.

Orchestration Engine Selection

Apache Airflow

The most widely adopted orchestration tool. Strong community, extensive connector ecosystem, and mature operational practices.

Strengths: Huge ecosystem of pre-built operators (connectors to cloud services, databases, APIs). Large community for support and extensions. Well-understood operational model. Strong scheduling capabilities.

Limitations: DAG-based design can be rigid for dynamic workflows. UI is functional but not intuitive. Can be complex to operate at scale. Limited support for real-time triggering.

Recommend when: The client has Python-skilled data engineers, needs a battle-tested solution, and has complex scheduling requirements.

Dagster

A modern alternative to Airflow with a stronger focus on data-aware orchestration.

Strengths: First-class data awareness (tracks what data each step produces and consumes). Better developer experience than Airflow. Strong testing support. Good support for ML-specific patterns.

Limitations: Smaller ecosystem than Airflow. Fewer pre-built integrations. Smaller community for troubleshooting.

Recommend when: The client values developer experience, needs strong data lineage, and is building new pipelines rather than migrating existing ones.

Prefect

A workflow orchestration tool designed for modern data workflows with a focus on simplicity.

Strengths: Python-native with minimal boilerplate. Excellent hybrid execution model (orchestration in the cloud, execution anywhere). Strong dynamic workflow support. Easy to get started.

Limitations: Less mature than Airflow. Commercial features (Prefect Cloud) needed for full functionality. Smaller ecosystem.

Recommend when: The client wants simplicity, has dynamic workflow requirements, and prefers a managed orchestration service.

Kubeflow Pipelines

ML-specific orchestration built on Kubernetes.

Strengths: Designed specifically for ML workflows. Strong integration with ML tools (experiment tracking, model serving, feature stores). Container-native execution.

Limitations: Requires Kubernetes expertise. Steep learning curve. Less flexible for non-ML workflows. Smaller community for general data engineering patterns.

Recommend when: The client is heavily invested in Kubernetes and needs ML-specific capabilities like experiment tracking integration and model versioning.

Workflow Architecture Patterns

Pattern 1: Extract-Transform-Train-Deploy (ETTD)

The standard ML pipeline pattern that covers the full lifecycle from data to deployed model.

Steps:

  1. Extract data from source systems
  2. Validate data quality
  3. Transform data into features
  4. Split into training and validation sets
  5. Train model
  6. Evaluate model performance
  7. Compare with current production model
  8. If improvement exceeds threshold, register new model version
  9. Deploy to staging
  10. Run integration tests against staging
  11. Deploy to production (with canary strategy)
  12. Monitor initial production performance

Pattern 2: Feature Pipeline

A pipeline dedicated to computing and serving ML features.

Steps:

  1. Extract data from source systems
  2. Validate source data quality
  3. Compute batch features
  4. Validate feature quality
  5. Write features to offline store (for training)
  6. Write features to online store (for serving)
  7. Update feature metadata and statistics
  8. Check for feature drift against reference distributions
  9. Alert if drift exceeds thresholds

Pattern 3: Monitoring and Retraining Loop

An automated loop that monitors model performance and triggers retraining when needed.

Steps:

  1. Collect production predictions and features
  2. When ground truth is available, compute performance metrics
  3. Compute data drift metrics
  4. Compare current performance against thresholds
  5. If degradation detected, trigger the ETTD pipeline
  6. If no degradation, log metrics and continue monitoring

Pattern 4: Multi-Model Ensemble

A pipeline that coordinates multiple models that work together.

Steps:

  1. Receive inference request
  2. Route request to relevant models based on input characteristics
  3. Collect predictions from each model
  4. Apply ensemble logic (voting, averaging, cascading)
  5. Apply business rules to ensemble output
  6. Return final prediction
  7. Log all intermediate predictions for debugging

Workflow Orchestration Anti-Patterns

The "Monolith Pipeline" Anti-Pattern. The entire ML workflow โ€” data extraction, feature engineering, training, evaluation, deployment, and monitoring โ€” lives in a single pipeline with 50 or more steps. When any step fails, the entire pipeline must be investigated. Changes to one step risk breaking downstream steps. The fix: decompose monolith pipelines into smaller, focused pipelines (data pipeline, feature pipeline, training pipeline, deployment pipeline) that communicate through well-defined interfaces.

The "Invisible Dependency" Anti-Pattern. Pipeline A writes data to a table. Pipeline B reads from that table. This dependency is not explicitly modeled in the orchestrator โ€” it works because Pipeline A runs at 2 AM and Pipeline B runs at 6 AM. When Pipeline A is delayed to 7 AM, Pipeline B runs on stale data and nobody knows until the model produces bad predictions. The fix: model all cross-pipeline dependencies explicitly in the orchestrator. Pipeline B should trigger based on Pipeline A's completion, not on a fixed schedule.

The "No Idempotency" Anti-Pattern. When a pipeline step fails and is retried, it produces duplicate records, corrupted state, or inconsistent results because the step was not designed to be safely re-executed. The fix: design every pipeline step to be idempotent โ€” running it twice with the same input should produce the same result as running it once. Use upsert operations, transaction boundaries, and output deduplication.

The "Alert-for-Everything" Anti-Pattern. Every pipeline step sends alerts on success, failure, and intermediate status. The operations team receives hundreds of alerts per day, most of them informational. Real failures are lost in the noise. The fix: alert only on failures that require action. Use structured alert levels โ€” critical alerts go to PagerDuty, warning alerts go to Slack, informational events go to a dashboard.

The "Hardcoded-Config" Anti-Pattern. Pipeline configurations โ€” database connection strings, file paths, model hyperparameters, threshold values โ€” are hardcoded in the pipeline code. Changing a configuration requires a code change, a code review, and a deployment. The fix: externalize all configuration. Use the orchestrator's variable management, environment variables, or a configuration service. Pipeline code should be configuration-driven, not configuration-embedded.

Orchestration for Real-Time AI Systems

While batch orchestration (scheduled pipelines that process data in batches) is the most common pattern, increasingly AI systems require real-time orchestration โ€” coordinating AI components that process events as they arrive.

Real-time orchestration patterns:

Event-driven inference. An event arrives (new transaction, user action, sensor reading), triggers a feature lookup, runs model inference, applies business rules, and produces a result โ€” all within a latency SLA (typically under 200ms). Orchestration here is not about scheduling but about managing the flow of data through the inference pipeline with minimal latency.

Streaming feature computation. Features are computed continuously from event streams (Kafka, Kinesis) rather than in scheduled batches. The orchestrator manages the streaming computation, monitors for lag and failures, and ensures features are available for real-time inference.

Hybrid batch-and-streaming. Most production systems combine batch and streaming. Batch pipelines compute complex features daily. Streaming pipelines compute time-sensitive features in real-time. The model consumes both. The orchestrator must coordinate both paradigms and manage the handoff between them.

Tools for real-time orchestration: Apache Flink for streaming computation, Apache Kafka for event streaming, Temporal for workflow orchestration with real-time triggers, and custom services for latency-critical inference pipelines.

Scaling Orchestration Across the Organization

As an organization's AI maturity grows, the number of pipelines proliferates. Managing 5 pipelines is straightforward. Managing 50 requires organizational structure.

Pipeline-as-code. Every pipeline definition should live in version control. Changes go through code review. Deployments are automated through CI/CD. This prevents the "snowflake pipeline" problem where each pipeline is configured differently by different engineers.

Template libraries. Build reusable pipeline templates for common patterns (ETTD, feature pipeline, monitoring loop). New pipelines are created from templates, ensuring consistency and reducing development time.

Resource pooling. Instead of each pipeline provisioning its own compute, use shared resource pools managed by the orchestrator. This improves utilization and reduces costs. Implement priority queues so critical pipelines get resources first.

Self-service pipeline creation. As the organization matures, data scientists and ML engineers should be able to create new pipelines using templates without requiring platform engineering support for every new pipeline. Build self-service capabilities that empower teams while maintaining standards.

Centralized monitoring. All pipelines should be visible in a single monitoring dashboard. Aggregate pipeline health metrics (success rate, execution time, resource utilization) across the organization. Identify systemic issues (a data source outage that affects 10 pipelines) rather than investigating each pipeline independently.

Documentation and knowledge management. Every pipeline should have documentation that describes its purpose, its dependencies, its schedule, its expected behavior, and its troubleshooting procedures. As the pipeline count grows, this documentation becomes essential for operational sustainability. New team members should be able to understand and operate any pipeline by reading its documentation.

Cost Management for Orchestrated Pipelines

Pipeline compute costs can grow silently as more pipelines are added and existing pipelines process more data. Implement cost tracking at the pipeline level so that every pipeline run has a known cost.

Pipeline cost optimization strategies: Schedule non-critical pipelines during off-peak hours when spot instances are more available and cheaper. Share compute resources across pipelines through resource pools rather than dedicating instances to each pipeline. Implement pipeline-level caching to avoid recomputing results that have not changed since the last run. Use incremental processing where possible โ€” process only the data that has changed since the last run rather than reprocessing the entire dataset.

Cost attribution at the pipeline level. Tag every compute resource with the pipeline and step that uses it. This enables cost per pipeline and cost per pipeline step tracking. When costs increase, you can identify exactly which pipeline and which step is driving the increase. Without pipeline-level cost attribution, cost increases are invisible until the monthly cloud bill arrives.

Right-sizing pipeline compute. Many pipeline steps are over-provisioned because engineers set resource requests conservatively. Profile each pipeline step's actual resource usage and right-size the resource requests. A step that uses 2 GB of memory but requests 16 GB is wasting compute resources that could serve other pipelines.

Delivery Process

Phase 1: Pipeline Discovery and Design (Weeks 1-3)

  • Inventory all existing AI pipelines and their current orchestration methods
  • Document pipeline dependencies, schedules, and compute requirements
  • Identify pipeline pain points (failures, visibility gaps, manual steps)
  • Select the orchestration engine based on requirements and team capabilities
  • Design the target pipeline architecture

Phase 2: Infrastructure Build (Weeks 4-7)

  • Deploy the orchestration engine
  • Configure compute infrastructure (executors, workers, resource pools)
  • Set up monitoring and alerting
  • Configure authentication and access control
  • Build reusable pipeline templates and operators for common patterns

Phase 3: Pipeline Migration (Weeks 8-14)

For each pipeline:

  1. Document the current pipeline logic and dependencies
  2. Implement the pipeline in the new orchestration engine
  3. Test with historical data
  4. Run in parallel with the existing pipeline to validate results
  5. Cut over to the new pipeline
  6. Decommission the old pipeline

Priority: Migrate the most critical and most painful pipelines first to demonstrate value quickly.

Phase 4: Optimization and Standardization (Weeks 15-18)

  • Optimize pipeline performance (parallelization, resource right-sizing)
  • Build standardized pipeline templates for common patterns
  • Implement pipeline-as-code practices (version control, code review, CI/CD)
  • Train the client's team on pipeline development and operations
  • Establish operational runbooks for common failure scenarios

Measuring Orchestration Success

Reliability metrics:

  • Pipeline success rate: Percentage of pipeline runs that complete successfully. Target: 98 percent or higher.
  • Mean time to recovery: Average time from pipeline failure to successful re-run. Target: under 30 minutes.
  • Alert-to-resolution time: Time from failure alert to resolution. Target: under 1 hour for critical pipelines.

Efficiency metrics:

  • Pipeline execution time: End-to-end run time. Track trends and optimize.
  • Resource utilization: Compute utilization during pipeline runs. Target: 70 percent or higher.
  • Cost per pipeline run: Total compute cost for each pipeline execution.

Operational metrics:

  • Manual intervention rate: Percentage of pipeline runs requiring manual intervention. Target: under 5 percent.
  • Pipeline development time: Time to build and deploy a new pipeline. Target: 50 percent reduction from pre-orchestration baseline.

Pricing Workflow Orchestration Engagements

  • Pipeline assessment and architecture design: $15,000 to $35,000
  • Orchestration engine deployment and core pipelines: $50,000 to $120,000
  • Full migration and optimization: $100,000 to $300,000
  • Ongoing pipeline operations: $5,000 to $15,000 per month

Your Next Step

This week: Audit your client's current pipeline orchestration. How many pipelines are orchestrated by cron jobs, shell scripts, or manual processes? Each one is a reliability risk and an orchestration opportunity.

This month: Evaluate Airflow, Dagster, and Prefect against your typical client's requirements. Build a comparison matrix and develop expertise on at least one platform.

This quarter: Deliver your first orchestration engagement. Start with the most painful pipeline, demonstrate dramatic improvement in reliability and visibility, and use that success to justify migrating remaining pipelines.

Search Articles

Categories

OperationsSalesDeliveryGovernance

Popular Tags

prompt engineeringai fundamentalsai toolsthe difference between AIMLagency operationsagency growthenterprise sales

Share Article

A

Agency Script Editorial

Editorial Team

The Agency Script editorial team delivers operational insights on AI delivery, certification, and governance for modern agency operators.

Related Articles

Delivery

Real-Time Stream Processing for AI Applications: The Complete Delivery Guide

When your client's AI model needs predictions in milliseconds instead of minutes, batch processing is not an option. Here is how to deliver production-grade stream processing for AI workloads.

A
Agency Script Editorial
March 21, 2026ยท14 min read
Delivery

Delivering Survival Analysis for Customer Retention: The AI Agency Playbook

A SaaS company knew their churn rate was 18 percent annually but could not predict when specific customers would leave. Survival analysis gave them a 90-day early warning system that saved $2.1 million in ARR.

A
Agency Script Editorial
March 21, 2026ยท13 min read
Delivery

Building Synthetic Data Generation Pipelines โ€” Creating Training Data When Real Data Is Scarce, Sensitive, or Biased

A healthcare AI company generated 500,000 synthetic patient records that preserved statistical patterns while eliminating privacy risk, cutting their model development timeline by 60%. Here is how to build synthetic data pipelines.

A
Agency Script Editorial
March 21, 2026ยท12 min read

Ready to certify your AI capability?

Join the professionals building governed, repeatable AI delivery systems.

Explore Certification