-
Notifications
You must be signed in to change notification settings - Fork 287
build your first basic workflow experimentation #3994
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
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
A couple of general questions.
|
docs/build-your-first-basic-workflow/build-your-first-workflow.mdx
Outdated
Show resolved
Hide resolved
docs/build-your-first-basic-workflow/build-your-first-workflow.mdx
Outdated
Show resolved
Hide resolved
docs/build-your-first-basic-workflow/build-your-first-workflow.mdx
Outdated
Show resolved
Hide resolved
docs/build-your-first-basic-workflow/build-your-first-workflow.mdx
Outdated
Show resolved
Hide resolved
docs/build-your-first-basic-workflow/build-your-first-workflow.mdx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is gorgeous! Great work. My comments are aimed at user-friendliness but may make it less pretty
docs/build-your-first-basic-workflow/build-your-first-workflow.mdx
Outdated
Show resolved
Hide resolved
docs/build-your-first-basic-workflow/build-your-first-workflow.mdx
Outdated
Show resolved
Hide resolved
| id: build-your-first-workflow | ||
| title: Build Your First Workflow | ||
| sidebar_label: "Part 1: Build Your First Workflow" | ||
| hide_table_of_contents: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i know that the layout is well designed and we could use the vertical space, but i still think this is a long enough tutorial that it'd be beneficial to have the TOC. It's easier for users to make sense of whey are doing in the context of the whole project. Right now, they can't see more than the H2 heading they are in.
brianmacdonald-temporal
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like we could use some text explanation for each of the code blocks. Maybe Point out specifically what the workflow is calling, and how that relates to the activities, and point out the Retry Policy details.
docs/build-your-first-basic-workflow/build-your-first-workflow.mdx
Outdated
Show resolved
Hide resolved
….mdx Co-authored-by: Milecia McG <47196133+flippedcoder@users.noreply.github.com>
….mdx Co-authored-by: Milecia McG <47196133+flippedcoder@users.noreply.github.com>
…ated and added light and dark mode reimburse diagram, max width 60
📖 Docs PR preview links |
| The Temporal Application will consist of the following pieces: | ||
|
|
||
| 1. **A Workflow** written in your programming language of choice and your installed Temporal SDK in that language. A Workflow defines the overall flow of the application. | ||
| 2. **An Activity** is a function or method that does specific operation - like withdrawing money, sending an email, or calling an API. Since these operations often depend on external services that can be unreliable, Temporal automatically retries Activities when they fail. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 2. **An Activity** is a function or method that does specific operation - like withdrawing money, sending an email, or calling an API. Since these operations often depend on external services that can be unreliable, Temporal automatically retries Activities when they fail. | |
| 2. **An Activity** is a function or method that does a specific operation - like withdrawing money, sending an email, or calling an API. Since these operations often depend on external services that can be unreliable, Temporal automatically retries Activities when they fail. |
|
|
||
| </SdkTabs.Java> | ||
|
|
||
| <SdkTabs.TypeScript> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor thing, but could we have the text wrap button in here like we have on other code blocks for all of these on the page? Example
| throw new ApplicationFailure(`Withdrawal failed. Error: ${withdrawErr}`); | ||
| } | ||
|
|
||
| //Execute the deposit Activity |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| //Execute the deposit Activity | |
| // Execute the deposit Activity |
| import type { PaymentDetails } from './shared'; | ||
|
|
||
| // highlight-next-line | ||
| export async function moneyTransfer(details: PaymentDetails): Promise<string> { // Workflow Definition: an exported async function |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: could the // Workflow Definition: an exported async function go above // highlight-next-line to keep it consistent with all the other comments?
| let withdrawResult: string; | ||
| try { | ||
| // highlight-next-line | ||
| withdrawResult = await withdraw(details); // Executes Activity via proxy and waits for result |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: could // Executes Activity via proxy and waits for result go above // highlight-next-line to keep it consistent with all the other comments?
| </div> | ||
| }> | ||
|
|
||
| Now that your Worker is running and polling for tasks, you can start a Workflow Execution. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might have missed it, but was there somewhere we told the users they would need 3 terminals? It confused me for a second that the first terminal we talked about under the text is Terminal 3.
| </SdkTabs> | ||
| </div> | ||
| <div style={{marginTop: '2rem', padding: '1rem', background: 'rgba(16, 185, 129, 0.1)', borderRadius: '0.5rem'}}> | ||
| <strong>Expected Success Output:</strong> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we put which terminal this should show in? It looks like Terminal 2.
|
|
||
| ## Check the Temporal Web UI | ||
|
|
||
| <SetupStep code={ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: could this open in a new tab instead of the docs one?
| const bank = new BankingService('bank2.example.com'); | ||
|
|
||
| // Comment out this working line: | ||
| // return await bank.deposit(details.targetAccount, details.amount, details.referenceId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might just be a formatting thing, but this looks different than the repo and the comment/uncomment snippets are in a different order (the good code is on top of the bug code).
| Try this advanced scenario of compensating transactions. | ||
|
|
||
|
|
||
| 1. **Modify the retry policy** in `workflows.py` to only retry 1 time |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we only want to highlight Python here or all the languages?
What does this PR do?
https://temporal-documentation-git-tutorial-layout-money-transfe-0fc0c4.preview.thundergun.io/build-your-first-basic-workflow/build-your-first-workflow
Notes to reviewers
files changed include new components for interaction and sdk boxed logos
wip (TODO: make light mode friendly)
aiming for: concise + engaging, dev-to-dev tone, consistent interactions, progressive disclosure.
next iteration: can include sdk box logos