Forum Academy Marketplace Showcase Pricing Features

Server Side Actions Documentation

Hello Everyone,

I just started building my first Bubble plugin. I’m developing a server side action, however the documentation that is available is not very clear to me. I’m looking for the following information:

  • List item What is the server runtime environment?

  • List item Which Javascript libraries / functions are available to be used?

  • List item How can I pass error and logging information back to my workflow?

  • List item How can I return an array of objects that can be processed in my workflow?

  • List item How can I read from files that are stored in Bubble?

  • List item How can I make requests to external web services from the action, and what are the restrictions (if any)?

I would be more than happy to write this up as an addition to the existing documentation if this is desired. It helps me when learning something new to write it down step-by-step.

Thanks in advance!

Andrew

1 Like

Hey @andrew7

Some of your questions have already been discussed in this topic …

Hello Misha,

Thank you for your reply. I have already read the official announcement, and it answers none of the questions in my post.

Best Regards,

Andrew

So,

I’m a little bit further in my own exploration of server side actions. I was able to get more information on the runtime environment by using the node.js ‘process.versions’ command:

{"http_parser":"2.7.0","node":"6.10.3","v8":"5.1.281.101","uv":"1.9.1","zlib":"1.2.11","ares":"1.10.1-DEV","icu":"58.2","modules":"48","openssl":"1.0.2k"}

So it seems that the runtime environment is node.js 6.10.3. This answers questions #1!

Andrew

We’re still waiting on @emmanuel to expand on this point:

We currently don’t expose libraries, but we’re looking into ways to add them on request or let people add them themselves.

Answered in detail …

Once you’ve picked this type for the action, you’ll be able to define what kind of data the action should return. It should return a flat JSON object, and you need to define first the keys and types for each key/value pair.

To summarise, you return a JSON object, and any of the values inside it can be a list (array) if defined first to be one.

Answered over several posts, including …

And yes, the request object is the one from node.

You’re getting closer to all your questions being answered, better think up some more! : )

To question:

Special action to ‘catch’ any error:

In settings language CORE error:

2 Likes

Hi Misha,

Thanks for the additional info! I’m indeed getting closer to my answers thanks to your help. In reply to some of your comments:

I notice that it isn’t possible to use ‘require’ to load any nodejs modules. So this really limits what can be done server side. I’m trying to read a file that is passed as a parameter to the plugin, however I can’t do anything with it!

This doesn’t allow returning an array of objects as ‘object’ is not a return type in the plugin editor. Unfortunately this is the functionality I’m looking for as I want to parse a file on the server, and then extract a list of objects from it and return it to the workflow.

If you have any thoughts / insights on this it would be greatly appreciated.

Cheers,

Andrew

Thanks! :smiley:

1 Like

@emmanuel I think this use case is valuable feedback for the beta of server code.

Did you ever find a solution for this? I’ve had to solve this problem for parsing and then storing data from PDFs in a Server Action (no external services).

Hey everyone I just published a nice article to initiate people on the server side aspect of plugin making :blush: