← Back to documentation

Environment Strategy

Use separate names, destinations, and rollback actions for each environment.

2 min read

Use this guide to keep staging and production traffic separate.

Purpose#

Use this guide to:

  • Separate the destinations for each environment.
  • Move reviewed changes to production.
  • Define the rollback actions before the production change.

Before you start#

  • Access to endpoint and relay-target management.
  • Destination URLs and inboxes for each environment.

Procedure#

1. Create environment-specific relay targets#

Examples:

  • billing-webhook-stg
  • billing-webhook-prod

Include the environment in the target name and the target description.

2. Create environment-specific endpoints#

Examples:

  • orders-intake-stg
  • orders-intake-prod

Keep the method, payload, and security configuration aligned. Let them differ only if the difference is intentional.

3. Use staging first#

  1. Attach only the staging destinations.
  2. Send representative traffic.
  3. Read the outcomes in Activity.
  4. Make sure that the destination operates as expected.

4. Promote to production#

  1. Apply the reviewed configuration to the production endpoint.
  2. Make sure that the production secrets and certificates are correct.
  3. Send a controlled production request.
  4. Monitor Activity during the change.

5. Document ownership and rollback#

For each production endpoint, record these items:

  • The team that owns the endpoint
  • The owner of the destination
  • The rollback action. If the senders can retry, pause the endpoint temporarily. Record the retry window of the sender and the Retry-After handling.
  • Each intentional change that disables an endpoint, removes or disables a destination, or rotates the URL. Record the traffic that PayloadRelay drops. A disabled URL and an old URL return 404. An endpoint with no enabled destination that matches can accept an event and not deliver it.

Expected result#

  • Staging and production stay isolated.
  • Promotion uses the same steps each time.
  • You can do the rollback quickly.

Common issues and fixes#

  • Traffic sent to the wrong destination: use naming rules, and review the destinations before you save.
  • Production-only problems: examine the production authentication, certificates, and headers again.
  • Confusing endpoint lists: use a consistent prefix or suffix.