Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python (sdk) workflow quickstart #974

Closed
mikeee opened this issue Feb 1, 2024 · 3 comments · Fixed by #975
Closed

python (sdk) workflow quickstart #974

mikeee opened this issue Feb 1, 2024 · 3 comments · Fixed by #975
Assignees
Milestone

Comments

@mikeee
Copy link
Member

mikeee commented Feb 1, 2024

Expected Behavior

The workflow quickstart in python has an incorrect "expected output"

Actual Behavior

The console app does not have any user inputs but the documentation includes:

To restock items, type 'restock'.
To exit workflow console app, type 'exit'.
Enter the name of one of the following items to order: paperclip, cars, computers: cars
How many cars would you like to purchase? 10
Starting order workflow, purchasing 10 of cars
INFO:NotifyActivity:Received order b903d749cd814e099f06ebf4a56a2f90 for 10 cars at $150000 !
INFO:VerifyInventoryActivity:Verifying inventory for order b903d749cd814e099f06ebf4a56a2f90 of 10 cars
INFO:VerifyInventoryActivity:There are 100 Cars available for purchase
INFO:RequestApprovalActivity:Requesting approval for payment of 150000 USD for 10 cars
(ID = b903d749cd814e099f06ebf4a56a2f90) requires approval. Approve? [Y/N] y

Actual output is:

		== APP - order-processor == *** Welcome to the Dapr Workflow console app sample!
		== APP - order-processor == *** Using this app, you can place orders that start workflows.
		== APP - order-processor == 2024-01-29 05:53:44.041 durabletask-worker INFO: Starting gRPC worker that connects to dns:127.0.0.1:41055
		== APP - order-processor == 2024-01-29 05:53:44.048 durabletask-worker INFO: Successfully connected to dns:127.0.0.1:41055. Waiting for work items...
		== APP - order-processor == item: InventoryItem(item_name=Paperclip, per_item_cost=5, quantity=100)
		== APP - order-processor == item: InventoryItem(item_name=Cars, per_item_cost=15000, quantity=100)
		== APP - order-processor == item: InventoryItem(item_name=Computers, per_item_cost=500, quantity=100)
		== APP - order-processor == ==========Begin the purchase of item:==========
		== APP - order-processor == Starting order workflow, purchasing 10 of cars
		== APP - order-processor == /home/runner/work/quickstarts/quickstarts/workflows/python/sdk/order-processor/app.py:49: UserWarning: The Workflow API is a Beta version and is subject to change.
		== APP - order-processor ==   start_resp = daprClient.start_workflow(workflow_component=workflow_component,
		== APP - order-processor == /home/runner/work/quickstarts/quickstarts/workflows/python/sdk/order-processor/app.py:86: UserWarning: The Workflow API is a Beta version and is subject to change.
		== APP - order-processor ==   state = daprClient.get_workflow(instance_id=_id, workflow_component=workflow_component)
		== APP - order-processor == 2024-01-29 05:53:48.056 durabletask-worker INFO: 90fe21d6-5fd2-438e-baba-0628d1050ae1: Orchestrator yielded with 1 task(s) and 0 event(s) outstanding.
		== APP - order-processor == INFO:NotifyActivity:Received order 90fe21d6-5fd2-438e-baba-0628d1050ae1 for 10 cars at $150000 !
		== APP - order-processor == 2024-01-29 05:53:48.061 durabletask-worker INFO: 90fe21d6-5fd2-438e-baba-0628d1050ae1: Orchestrator yielded with 1 task(s) and 0 event(s) outstanding.
		== APP - order-processor == INFO:VerifyInventoryActivity:Verifying inventory for order 90fe21d6-5fd2-438e-baba-0628d1050ae1 of 10 cars
		== APP - order-processor == INFO:VerifyInventoryActivity:There are 100 Cars available for purchase
		== APP - order-processor == 2024-01-29 05:53:48.067 durabletask-worker INFO: 90fe21d6-5fd2-438e-baba-0628d1050ae1: Orchestrator yielded with 1 task(s) and 0 event(s) outstanding.
		== APP - order-processor == INFO:RequestApprovalActivity:Requesting approval for payment of 150000 USD for 10 cars
		== APP - order-processor == 2024-01-29 05:53:48.072 durabletask-worker INFO: 90fe21d6-5fd2-438e-baba-0628d1050ae1: Orchestrator yielded with 1 task(s) and 1 event(s) outstanding.
		== APP - order-processor == /home/runner/work/quickstarts/quickstarts/workflows/python/sdk/order-processor/app.py:95: UserWarning: The Workflow API is a Beta version and is subject to change.
		== APP - order-processor ==   state = daprClient.get_workflow(instance_id=_id, workflow_component=workflow_component)
		== APP - order-processor == /home/runner/work/quickstarts/quickstarts/workflows/python/sdk/order-processor/app.py:79: UserWarning: The Workflow API is a Beta version and is subject to change.
		== APP - order-processor ==   daprClient.raise_workflow_event(instance_id=_id, workflow_component=workflow_component,
		== APP - order-processor == 2024-01-29 05:53:58.059 durabletask-worker INFO: 90fe21d6-5fd2-438e-baba-0628d1050ae1 Event raised: manager_approval
		== APP - order-processor == 2024-01-29 05:53:58.059 durabletask-worker INFO: 90fe21d6-5fd2-438e-baba-0628d1050ae1: Orchestrator yielded with 2 task(s) and 0 event(s) outstanding.
		== APP - order-processor == INFO:NotifyActivity:Payment for order 90fe21d6-5fd2-438e-baba-0628d1050ae1 has been approved!
		== APP - order-processor == 2024-01-29 05:53:58.065 durabletask-worker INFO: 90fe21d6-5fd2-438e-baba-0628d1050ae1: Orchestrator yielded with 2 task(s) and 0 event(s) outstanding.
		== APP - order-processor == INFO:ProcessPaymentActivity:Processing payment: 90fe21d6-5fd2-438e-baba-0628d1050ae1 for 10 cars at 150000 USD
		== APP - order-processor == INFO:ProcessPaymentActivity:Payment for request ID 90fe21d6-5fd2-438e-baba-0628d1050ae1 processed successfully
		== APP - order-processor == 2024-01-29 05:53:58.069 durabletask-worker INFO: 90fe21d6-5fd2-438e-baba-0628d1050ae1: Orchestrator yielded with 2 task(s) and 0 event(s) outstanding.
		== APP - order-processor == INFO:UpdateInventoryActivity:Checking inventory for order 90fe21d6-5fd2-438e-baba-0628d1050ae1 for 10 cars
		== APP - order-processor == INFO:UpdateInventoryActivity:There are now 90 cars left in stock
		== APP - order-processor == 2024-01-29 05:53:58.077 durabletask-worker INFO: 90fe21d6-5fd2-438e-baba-0628d1050ae1: Orchestrator yielded with 2 task(s) and 0 event(s) outstanding.
		== APP - order-processor == INFO:NotifyActivity:Order 90fe21d6-5fd2-438e-baba-0628d1050ae1 has completed!
		== APP - order-processor == 2024-01-29 05:53:58.081 durabletask-worker INFO: 90fe21d6-5fd2-438e-baba-0628d1050ae1: Orchestration completed with status: COMPLETED
		== APP - order-processor == Workflow completed! Result: Completed
		== APP - order-processor == Purchase of item is  Completed

Steps to Reproduce the Problem

@DeepanshuA
Copy link
Contributor

/assign

@DeepanshuA
Copy link
Contributor

Thanks @mikeee for raising this.
I will update README to remove the manual intervention line:
(ID = b903d749cd814e099f06ebf4a56a2f90) requires approval. Approve? [Y/N] y

@DeepanshuA DeepanshuA mentioned this issue Feb 5, 2024
4 tasks
@paulyuk paulyuk added this to the 1.13 milestone Feb 11, 2024
@mikeee
Copy link
Member Author

mikeee commented Feb 26, 2024

Fixed in #975

@mikeee mikeee closed this as completed Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants