https://github.com/temporalio/subscription-workflow-project-template-php
Subscription Workflow Project Template for PHP
https://github.com/temporalio/subscription-workflow-project-template-php
Last synced: 12 months ago
JSON representation
Subscription Workflow Project Template for PHP
- Host: GitHub
- URL: https://github.com/temporalio/subscription-workflow-project-template-php
- Owner: temporalio
- Created: 2021-05-21T14:27:58.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2025-06-06T17:16:41.000Z (about 1 year ago)
- Last Synced: 2025-06-06T17:38:07.129Z (about 1 year ago)
- Language: PHP
- Size: 15.8 MB
- Stars: 13
- Watchers: 10
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Subscription Workflow Project Template in PHP
This project template illustrates the design pattern for subscription style business logic.
**Setup**
Run the Temporal Server:
```bash
git clone https://github.com/temporalio/docker-compose.git
cd docker-compose
docker-compose up
```
Start the RoadRunner Server:
```bash
composer install
./rr serve
```
**Start**
Start the Workflow Execution for a single customer with the Id of "Id-0".
```bash
php app.php subscription
```
**Get billing info**
You can Query the Workflow Execution for the customer's billing information.
The current billing period and the charge amount will be returned.
```bash
php app.php querybillinginfo
```
Run this multiple times to see the billing period number and charge amount change over the course of the Workflow Execution.
**Update billing**
You can also send a Signal to the Workflow Execution to update the billing cycle cost to 300.
```bash
php app.php updatecharge
```
**Cancel subscription**
You can send a Signal to the Workflow Execution to cancel the subscription.
The Workflow Execution will complete after the current billing period.
```bash
php app.php cancelsubscription
```
After running this, check out the [Temporal Web UI](http://localhost:8088/) to see that the Workflow Execution has a "Completed" status.