Skip to content

Add best practices documentation for workflow development#724

Open
mcruzdev wants to merge 3 commits into
quarkiverse:mainfrom
mcruzdev:issue-723
Open

Add best practices documentation for workflow development#724
mcruzdev wants to merge 3 commits into
quarkiverse:mainfrom
mcruzdev:issue-723

Conversation

@mcruzdev

@mcruzdev mcruzdev commented Jul 3, 2026

Copy link
Copy Markdown
Member

Description

Covers four common pitfalls: using @Transactional for persistence instead of manual QuarkusTransaction, referencing secrets via handles instead of hard-coding credentials, naming tasks explicitly for observability, and separating business retries (tryCatch with retry) from infrastructure retries (Fault Tolerance config properties).

Fixes #723

Testing

Test Plan

  • Unit tests added/updated
  • Integration tests added/updated (if applicable)
  • Tested manually (describe below if applicable)

Manual Testing

Checklist

Before submitting this PR, please ensure:

  • I ran the full build with integration tests locally: ./mvnw clean install -DskipITs=false
  • Code follows the project's code conventions
  • Tests have been added/updated to cover the changes
  • Documentation has been updated (if user-facing changes)
  • Commit messages are clear and follow conventional commits style
  • I have read and followed the Contributing Guide
  • I have read and comply with the LLM Usage Policy (if applicable)

Additional Notes

Covers four common pitfalls: using @transactional for persistence
instead of manual QuarkusTransaction, referencing secrets via handles
instead of hard-coding credentials, naming tasks explicitly for
observability, and separating business retries (tryCatch with retry)
from infrastructure retries (Fault Tolerance config properties).
@mcruzdev
mcruzdev requested a review from a team as a code owner July 3, 2026 18:10
Signed-off-by: Matheus Cruz <matheuscruz.dev@gmail.com>
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

🚀 PR Preview babc866 has been successfully built and deployed to https://quarkiverse-flow-pr-724-preview.surge.sh

return workflow("notify")
.use(u -> u.secrets("mySecrets"))
.tasks(
// NEVER hard-code tokens in the workflow definition

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The token is not hard-coded in this example. 🤔

Comment thread docs/modules/ROOT/pages/best-practices.adoc Outdated
.delay("PT1H"))
.doTasks(tasks(
function("notifyRejection", approvalService::notifyRejection, VacationRequest.class))))))
.build();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tested this code? If not, it's a great way to deliver a simple example.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"tryApproval",
t -> t.tryCatch(tasks(
function("submitRequest", approvalService::submit, VacationRequest.class),
function("checkApproval", approvalService::requireApproval, VacationRequest.class)))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the VacationRequest.class parameter is unnecessary.

…deable files

Signed-off-by: Matheus Cruz <matheuscruz.dev@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: Document Quarkus Flow best practices

2 participants