Skip to content

Conversation

@mo-amir-code
Copy link

Description

Added a method to validate all the required sub-block values of each block of current workflow.

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context:

I added a method to check all the required sub-blocks values of workflow blocks. If any required field is missing then it is showing error alert/notification message only for first detected unfilled required sub-block value. For example: user created a workflow with 4 blocks and missed 2 required sub-block values in two different block then that method will show alert message for first unfilled sub-block value because it is checking flow wise and if user filled that required sub-block value and then the method will give an error message again to another unfilled sub-block value.

Fixes #340

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • All tests pass locally and in CI (bun run test)
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
  • I have updated version numbers as needed (if needed)
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Security Considerations:

  • My changes do not introduce any new security vulnerabilities
  • I have considered the security implications of my changes

Additional Information:

Any additional information, configuration or data that might be necessary to reproduce the issue or use the feature.

@vercel
Copy link

vercel bot commented May 18, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 18, 2025 1:08pm

@vercel
Copy link

vercel bot commented May 18, 2025

@mo-amir-code is attempting to deploy a commit to the Sim Studio Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR adds validation for required sub-block values in workflow blocks, improving error handling by providing specific error messages for missing required fields before execution begins.

  • Added handleCheckRequiredFieldsOfAllBlocks method in /apps/sim/app/w/[id]/hooks/use-workflow-execution.ts to validate required inputs
  • Method checks blocks sequentially and shows error notification for first missing required field
  • Integrated validation into workflow execution flow through handleRunWorkflow
  • Provides user-friendly error messages like "API key is required for block X" instead of generic errors
  • Addresses issue #340 by improving error visibility and debugging experience

💡 (1/5) You can manually trigger the bot by mentioning @greptileai in a comment!

1 file(s) reviewed, 2 comment(s)
Edit PR Review Bot Settings | Greptile

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
@emir-karabeg
Copy link
Collaborator

@mo-amir-code the use workflow execution doesn't only run in the UI, but on the API, webhook, and chat message. How can we return a value so that an error is displayed for those?

@mo-amir-code
Copy link
Author

@emir-karabeg I was thinking only in UI, I will start working on it

@waleedlatif1 waleedlatif1 force-pushed the main branch 6 times, most recently from 1b3f825 to b9b662b Compare May 21, 2025 16:13
@emir-karabeg
Copy link
Collaborator

@mo-amir-code any updates? :D

@emir-karabeg emir-karabeg marked this pull request as draft May 26, 2025 08:43
@mo-amir-code
Copy link
Author

@emir-karabeg
I wanted to let you know that I’m currently unable to continue working on the PR due to my ongoing college exams. As the exams are still in progress, I won’t be able to contribute further at the moment.

Please feel free to reassign or let someone else take over the task if needed. I really appreciate the opportunity to contribute and hope to be more active once my exams are over.

Thanks for your understanding.

@emir-karabeg
Copy link
Collaborator

@mo-amir-code no problem! Best of luck with your exams and looking forward to hearing from you soon! Let us know if we can help in any way :D @waleedlatif1 and I studied CS at Berkeley

@waleedlatif1 waleedlatif1 force-pushed the main branch 2 times, most recently from 5fec813 to b42c43a Compare June 28, 2025 04:14
@waleedlatif1
Copy link
Collaborator

resolved by #843

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.

[REQUEST] Better Error Handling

3 participants