Back to all articles
tutorialproduct

Getting Started with pflow

Learn how to install and use pflow to compile your prompts into deterministic CLI commands.

Getting Started with pflow

This guide will help you get started with pflow in just a few minutes.

Installation

Install pflow using the install script:

curl -fsSL https://pflow.run/install.sh | sh

Or if you prefer using npm:

npm install -g @pflow/cli

Your First Workflow

Create a simple workflow that fetches weather data:

import { workflow, http, shell } from "@pflow/core";

const getWeather = workflow("get-weather")
  .input({ city: "string" })
  .pipe(
    http.get("https://api.weather.com/v1/current", {
      params: { q: "${city}" },
    })
  )
  .pipe(
    shell.run('echo "Temperature: ${response.temp}°C"')
  );

export default getWeather;

Compiling Workflows

Once you've defined your workflow, compile it to a deterministic CLI command:

pflow compile ./workflows/get-weather.ts

This generates an optimized, standalone executable that runs without any AI inference.

Configuration

Create a pflow.config.ts file in your project root:

import { defineConfig } from "@pflow/cli";

export default defineConfig({
  // Output directory for compiled workflows
  outDir: "./dist",

  // Enable verbose logging
  verbose: true,

  // Node types to enable
  nodes: ["http", "shell", "mcp"],
});

Next Steps

Happy building! 🚀