Refinery.io is a SaaS platform for creating AWS serverless applications. By utilizing an intuitive drag and drop interface, which resembles and functions like a flowchart tool, it is quick and easy to combine pre-built Code Blocks to create serverless apps. The AWS Lambda backed Code Blocks allow you to write the business logic layer in any supported language such as Python or Node.js. The combination of graphical and programmatic elements brings together the simplicity of GUI tools while still allowing for complicated logic and applications.
- Refinery.io account. Right now the cost is $5 a month base cost plus resource cost.
Note: Refinery is giving out $5 free if you sign up right now which is a free month!
Creating a New Project
After logging in navigate to the All Projects page
In the "Create New Project" section add a Project Name and then click "Create Project"
After the new project is created then you should see the Editor window similar to below
And now you have a brand new Refinery project ready to create a serverless application!
One of the first steps for any serverless application is to determine what event will start the app. In this simple Hello World application we are going to use a timer event which will fire every minute.
Click on the "Add Block" button on the left side menu and then select the "Timer Block".
Click on the newly added Timer Block on the editor window if it is not already selected, and then in the "Edit Block" panel edit the name and schedule expression to match the below screenshot.
Then hit the "Save" button to save those edits to that block.
After saving the Timer Block, open the Add Block menu again and add in two "Code Block" elements
Select one of the Code Blocks and edit the Block Code and Block Name to match the screenshot below
Then select the other Code Block and edit the same fields but as shown below
The first code block will output "Hello" when triggered while the second code block will take in an input, in this case, "Hello" from the first block, and append it to " World!" to complete the typical Hello World! program.
The last piece needed here is to define the order of these blocks. This order will be simple in this example but there are many different types of transitions which can be combined to create more complicated applications.
Click on the "Example Timer Block" to define a transition after that block completes. Click on the Add Transition button underneath the Add Block button on the left menu. From that menu select the "Then Transition" and click on the "Example Hello Code Block" to assign the output of the transition.
This transition will just pass the input from one block onto another. In this case, it will call the Example Hello Code Block every minute that the Timer Block fires.
Add one more Then Transition from the Example Hello Code Block to the Example World Code Block to complete this Hello World serverless application.
The completed application should look like the following in the Editor window.
Deploy and Test
To deploy this application to AWS is as simple as clicking "Save Project" and then "Deploy Project". That's it!
After a minute or so the deployment should complete and the window should show the "Deployment" window. The code is already running so after another minute the timer trigger should run and the "Block Executions" panel should show a success like the following.
If you click on the "a minute ago" block then the execution logs for the app will show up on the right side. If you click on the bottom code block "Example World Code Block" then the execution details should show the input data of "Hello" and the return data of "Hello World!"
And that is it! A Hello World serverless application that runs every minute on AWS and outputs "Hello World!". It may not seem like much but there is a lot of possibilities for creating small microservice applications quickly and easily.
Refinery.io is a SaaS platform for creating AWS serverless applications with a simple drag and drop, flowchart like GUI. Yet unlike other GUI tools Refinery also allows for the coding of Lambda segments which makes it very flexible.