liveBook · Manning

PactFlow

As explained in Contract Testing in Action

PactFlow is a hosted contract-testing platform that provides broker, verification, and deployment-safety capabilities.

When consumer and provider code live in separate repositories, teams need a shared place to publish contracts, record verification, and see whether a change is safe to release. PactFlow is a hosted, fully managed Pact Broker that supplies that central service without requiring teams to run the broker infrastructure themselves. section 4.4 section 9.0

Contracts are published from consumer workflows, retrieved and verified by providers, and returned with verification status. PactFlow presents contract pairings and details, helping teams coordinate API or event interactions and integrate contract testing into CI/CD pipelines. section 9.3 section 9.6

Choose PactFlow when a hosted broker’s operational and security features outweigh its running cost:

  • Avoid provisioning, patching, and maintaining self-hosted broker infrastructure; hosted service provides stability and support. section 9.2 section 9.5
  • Use bearer API tokens that can be rotated or revoked, plus user-management capabilities, rather than the self-hosted example’s username-and-password credentials. section 9.5 section 9.6
  • Adopt added capabilities such as UI enhancements, OpenAPI specification support, third-party integrations, contract stubs, and can-i-deploy checks. section 9.5 section 9.6

Publish a consumer contract

Create a PactFlow account, obtain its base URL and API token, and expose them as environment variables. A package script can run pact-broker publish against the pacts directory with a consumer version, tag, broker URL, and token. The uploaded contract initially appears as unverified until provider verification is published. section 4.4 section 9.3.1

PactFlow can also trigger provider work automatically. Store a GitHub personal-access token as a PactFlow secret, then configure a webhook for the “contract requiring verification published” event to dispatch a GitHub request carrying the pact URL, provider version, and branch. section 10.4.1

For provider-driven contract testing, PactFlow adapters support a bring-your-own-tools approach. Existing consumer tests can generate contracts, while providers can use API tests or OpenAPI specifications rather than adopting a new Pact verification workflow. section 11.1.2 section 11.3

Figure 9.19 Can I Deploy UI within PactFlow, showing additional benefits of PactFlow
figure

The can-i-deploy view illustrates how verification status can be checked before deployment. section 9.5

How Contract Testing in Action covers it

How deep it goes
Explains setup, CLI publishing, hosted-versus-self-hosted trade-offs, webhooks, security, and adapter-based workflows.
Examples
Uses consumer contract publishing, a MoviesAPI GitHub webhook, and Postman and Dredd provider verification examples.
What it assumes
Starts account setup from zero while assuming contracts have been generated for consumer and provider workflows.
What you can do after
Operate/configure it by publishing contracts, securing credentials, triggering verification, and assessing hosted versus self-hosted broker options.
How it connects
Connects Pact Broker, consumer-driven contract testing, provider-driven contract testing, OpenAPI, webhooks, CI/CD, and GitHub.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Contract Testing in Action. The section links point to the parts of the book it draws on.