Skip to content

Commit

Permalink
Merge pull request #2 from temporalio/abhinav/cleanup
Browse files Browse the repository at this point in the history
Cleanup
  • Loading branch information
anekkanti authored Sep 26, 2023
2 parents fad204f + badd4b0 commit df93922
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 18 deletions.
19 changes: 7 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
# Temporal Cloud API Samples

This repository contains several sample Workflow applications that demonstrate the various capabilities of the Temporal Cloud APIs.
This repository contains several samples that demonstrate the various capabilities of the Temporal Cloud.

* Temporal Cloud API repo: [temporalio/cloud-api](https://github.com/temporalio/api-cloud)
## Cloud Temporal Client

## WorkflowTypes
Sample Go temporal client for a namespace hosted on Temporal Cloud: [client.go](client/temporal/client.go)

## Cloud API Workflows

Sample Workflow applications that exercises the Temporal Cloud APIs: [README.md](cmd/worker/README.md)

| WorkflowType | Description |
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| `tmprlcloud-wf.get-user` | Get an existing user. |
| `tmprlcloud-wf.get-users` | List all users. |
| `tmprlcloud-wf.create-user` | Create a new user. |
| `tmprlcloud-wf.update-user` | Update an existing user. |
| `tmprlcloud-wf.delete-user` | Delete an existing user. |
| `tmprlcloud-wf.reconcile-user` | Reconcile a user. Creates the user if one does not exist, otherwise updates the existing one. |
| `tmprlcloud-wf.reconcile-users` | Reconcile set of users. Creates the users that do not exist, updates the existing ones. Optionally can delete the users that are not unaccounted. |
29 changes: 23 additions & 6 deletions cmd/worker/README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,33 @@
# Demo
Cloud Operations Workflows in Action
# Worker

## Step 1
A worker that invokes the temporal cloud apis to perform various operations.

Temporal Cloud APIs are located at Repo: [temporalio/cloud-api](https://github.com/temporalio/api-cloud)

## Supported Workflows

| WorkflowType | Description |
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| `tmprlcloud-wf.get-user` | Get an existing user. |
| `tmprlcloud-wf.get-users` | List all users. |
| `tmprlcloud-wf.create-user` | Create a new user. |
| `tmprlcloud-wf.update-user` | Update an existing user. |
| `tmprlcloud-wf.delete-user` | Delete an existing user. |
| `tmprlcloud-wf.reconcile-user` | Reconcile a user. Creates the user if one does not exist, otherwise updates the existing one. |
| `tmprlcloud-wf.reconcile-users` | Reconcile set of users. Creates the users that do not exist, updates the existing ones. Optionally can delete the users that are unaccounted. |

## Running the worker

### Step 1: Generate an apikey
Generate an apikey by either visiting the [Cloud UI](https://cloud.temporal.io/settings/api-keys) or using [tcld](https://github.com/temporalio/tcld#creating-an-api-key).

## Step 2
Start the demo worker with the APIKey
### Step 2: Start the worker
Start the worker using the APIKey
```
TEMPORAL_CLOUD_API_KEY=<apikey> go run ./demo
```

## Step 3
### Step 3: Run a workflow
Run a workflow using `tctl` for example to invoke `get-users` workflow run:
```
tctl wf start --tq demo --wt cloud-operations-workflows.get-users -i '{}'
Expand Down

0 comments on commit df93922

Please sign in to comment.