usebruno / bruno

Opensource IDE For Exploring and Testing Api's (lightweight alternative to postman/insomnia)
https://www.usebruno.com/
MIT License
27.78k stars 1.28k forks source link

RFC: Workflows in Bruno #87

Open helloanoop opened 1 year ago

helloanoop commented 1 year ago

It is a pretty common use case for a user to have a set of common requests to be executed before running a request. Examples includes: registration and login, setting up the state of the cart etc.

Here is what I am thinking. In Bruno, every folder has a index.bru file which contains the common things to be run across all the requests under it like auth, headers etc. To indicate that a folder is a workflow, we add a property called workflow: true inside the meta tag

meta {
  name: Login Workflow
  workflow: true
}

And other requests that need to run a workflow before or after a request can do like below

meta {
  name: Create Order
}

workflows {
  preRequest: login
  postResponse: cleanup
}

A request can execute multiple workflows by specifying the workflows as a comma separated list.

tibeer commented 1 year ago

This sounds very interesting. I bet a lot of users have a more complex use case, but mine is simply getting a bearer token for my >400 requests. Currently, I manually run the request from time to time to get the bearer token and save it to an env variable. But it would be quite comfortable to have an option to define an environment variable, that is "just a link" to another request with some filters on the response. I guess Insomnia can do stuff like this. On the other hand: This creates some clutter and it might harm the very clean structure bruno has currently. Keep up the good work :)

mikaoelitiana commented 1 year ago

This is one of the feature I am really hoping to see soon in Bruno ❤️

mj-h commented 12 months ago

Interesting idea! If we find a way to incorporate "check-status-until-OK-then-continue" kind of workflows, then we would not need .setNextRequest() (https://github.com/usebruno/bruno/issues/534):

balajiv113 commented 4 months ago

Any updates on this feature ? Looking forward to this. Happy to contribute as well

helloanoop commented 4 months ago

@balajiv113 This is on our roadmap for Q4 (Oct-Dev) 2024