Show workflow scheduled tasks for the user

Hello,

It’s possible to show for the user all tasks that are scheduled and “belong” to him? In my application the user is buying the things that will be sent to him every day. I want to show him the queue where he can check additional information about thing that he will receive and that are already scheduled. After every successful executed scheduled task I will be saving the thing to the database. Then I can show him the successfully sent thing but also I want to show him the waiting things. I am afraid that you will tell me that I should create a database table for the waiting things :sweat_smile:

Error handling on the backend workflow side:
Can you tell me how I can handle any error that will appear on the backend workflow? For example when API Connector endpoint return something else than 200, or return some error response in the body? I should create a trigger for workflow errors on the backend side or on the frontend side?

Best Regards,
Mateusz

Yeah yeah :sweat_smile:

What I would do is, in this table, create a column to store the errors in cases where the API return any code different then 200.

So your users will see the tasks that were not processed and also the given error, with the opportunity to reschedule if wanted.

1 Like

I am afraid that I can’t do it because I am executing this API Call when I am creating the new thing to the database. I don’t know how to execute in different way the API Call from API Connector step before and use the result in the next step.

Could you share an image of your workflow in more details?

Of course.

In messageId property I am executing the API Connector endpoint. Do you have an idea how to execute it before this step?

Why don’t you call it in frontend? In your main workflow….
Doing this you will be able to retrieve the return of your call in the second step of your workflow…

Because I need to schedule that call and as far as I know there is no possibility to schedule that on the frontend side

You can pass a message to the user on the front end from the back end by creating a text field in user called something like api message and then writing an error value to it in your backend workflow.

On your front end page you’d need a conditional like when current user’s api message is not empty to kick off your workflow

At its simplest, the front-end workflow might look like

  1. Show popup ‘API Message’ (or whatever you want to use to display your error)
  2. Send data (text) current user’s api message to popup ‘api message’
  3. Make changes to current user api message: [empty]

Step 3 is important because it sets the error message inside user back to empty so the page conditional workflow can ‘see’ another future change in state from empty to not empty and be triggered again on a future error. Also it won’t trigger whatever the last error was on page load.

If you want to get more fancy
you can send structured text to the front end. You could send a string like "error|[your error message here]" or "success|[success message here]" and interpret it conditionally in the front end using regex

For example on your page conditional workflow.
when api message:extract with regex:first item is “error”
(Run a workflow for an error and display the text)

your regex being [^|]+ to parse the text into a list using the pipe | as a delimiter

This topic was automatically closed after 70 days. New replies are no longer allowed.