Stoobly Docs
  • Introduction
  • Use Cases
    • Generate Mock APIs
      • Empower Development
      • Scale API Testing
    • Enable E2E Testing
  • FAQ
    • Recording
    • Mocking
    • Terminology
  • Getting Started
    • Installing the Agent
      • Installation with pipx
      • Installation with Docker
  • Core Concepts
    • Agent
      • Intercept Modes
        • Mocking
        • Recording
      • Lifecycle Hooks
      • Proxy Settings
        • Data Rules
        • Firewall Rules
        • Rewrite Rules
        • Match Rules
    • Context
    • Mock API
      • Request
        • Response
        • Replay History
      • Scenarios
      • Snapshots
      • Fixtures
      • Public Folder
    • Scaffold
      • Service
      • Validation
      • Workflow
  • Guides
    • How to Run the Agent
      • Run with CLI
      • Run with Docker
    • How to Configure the Agent
      • Forward Proxy
        • Enable HTTPS Traffic
      • Reverse Proxy
    • How to Record Requests
      • Recording from the UI
      • Recording from the CLI
      • How to Create Contexts
      • How to Create Scenarios
        • Creating from the UI
        • Creating from the CLI
      • How to Create Requests
      • How to Customize Recordings
        • Customizing with Lifecycle Hooks
    • How to Update Requests
      • Editing from the UI
      • Editing with Snapshots
      • How to Update Scenarios
        • Updating with Overwrite
        • Updating with Replay
      • Updating with Replay
        • Replaying from the UI
        • Replaying from the CLI
        • How to Customize Replays
          • Customizing with Lifecycle Hooks
      • Updating with Open API
    • How to Mock APIs
      • How to Enable Mocking
        • Enabling from the UI
        • Enabling from the CLI
      • How to Snapshot Requests
        • Deleting Snapshots
        • Sharing Snapshots
      • How to Use Fixtures
      • How to Customize Mocking
        • Customizing with Lifecycle Hooks
        • Customizing with Request Headers
      • Troubleshooting
    • How to Replay Requests
      • Replay with the UI
      • Replay with the CLI
    • How to Integrate E2E Testing
      • How to Scaffold an App
        • Scaffolding a Service
        • Customizing a Workflow
          • Customizing Container Services
          • Customizing Lifecycle Hooks
          • Customizing Init Scripts
          • Customizing Configure Scripts
          • Customizing Makefile
        • Troubleshooting
      • How to Run a Workflow
        • Running with CLI command
        • Running with Make
        • Troubleshooting
          • Validating
      • How to Stop a Workflow
        • Stopping with CLI command
        • Stopping with Make
      • How to Update a Scaffold
        • Deleting a Service
      • FAQ
  • Developer Guide
    • Installation from Source
    • Submitting Change Requests
    • Releases
  • Experimental
    • Experimental Features
      • Aliases
      • Endpoints
      • API Testing
        • Getting Started
        • Configuration
          • Assign
          • Lifecycle Hooks
          • Trace
      • Optional Components
Powered by GitBook
On this page
  • Background
  • File Structure
  • Core Workflows
  • Record
  • Mock
  • Test

Was this helpful?

  1. Core Concepts
  2. Scaffold

Workflow

PreviousValidationNextHow to Run the Agent

Last updated 1 month ago

Was this helpful?

A workflow groups configurations for services to perform distinct use cases. By default, Stoobly provides configurations for the record, mock and test workflows.

Background

To learn more about the role of individual services, see:

To run a workflow, see:

To validate a workflow, see:

File Structure

To learn how each file is used, see .

Any hidden file will be overritten when the scaffold service create command is rerun.

bin/init

First script that executes when a workflow runs. Should contain any commands needed for the service to initialize.

bin/.init

Maintained file that will be overriden on scaffold create.

bin/configure
bin/.configure

Maintained file that will be overriden on scaffold create.

docker-compose.yml

Custom docker-compose.yml file. Container services defined in this should should include:

  • Respective <WORKFLOW-NAME> under the profiles property

  • Either app.egress or app.ingress under the networks property

.docker-compose.<WORKFLOW-NAME>.yml

Maintained file that will be overriden on scaffold create.

fixtures.yml
lifecycle_hooks.py
public

Core Workflows

Record

The journey of a request:

  1. A request gets sent from the host e.g. browser or cURL

  2. Gets sent to the gateway service

  3. Gateway service routes the request based on hostname

  4. Request gets intercepted by Stoobly running as a proxy

    1. Lifecycle hooks get triggered

  5. Stoobly reverse proxies the request to the local or external API

  6. On response, Stoobly records the request to its respective .stooblyfolder

    1. Lifecycle hooks get triggered

Mock

The journey of a request:

  1. A request gets sent from the host e.g. browser or cURL

  2. Gets sent to the gateway service

  3. Gateway service routes the request based on hostname

  4. Request gets intercepted by Stoobly running as a proxy

    1. Lifecycle hooks get triggered

  5. Stoobly mocks requests if it has been previously recorded. If the request is not found, it can conditionally reverse proxy the request to the local or external API

    1. Lifecycle hooks get triggered

Test

The journey of a request:

  1. A request gets sent from the entrypoint service

  2. Gateway service routes the request based on hostname

  3. Request gets intercepted by Stoobly running as a proxy

    1. Lifecycle hooks get triggered

  4. Stoobly mocks requests if it has been previously recorded. If the request is not found, it can conditionally reverse proxy the request to the local or external API

    1. Lifecycle hooks get triggered

Second script that executes when a workflow runs. Should contain configuration commands for Stoobly. See , , and .

Enables defining mock responses for specific URL patterns. To learn more see .

Enables reading and modifying requests during specific points in their lifecycle. To learn more see .

Enables defining mock request paths and responses using files stored in this folder. To learn more see .

firewall rules
match rules
rewrite rules
here
here
here
Service
How to Run a Workflow
Validation
Flow diagram for recording requests
Flow diagram for mocking requests
Flow diagram for testing an application that sends requests
here