Introducing the IBM Bluemix OpenWhisk Editor

Share this post:

Republished from the OpenWhisk blog

New to OpenWhisk?

Watch Discover dark data behind videos for an example of using OpenWhisk to build a scalable application using YouTube and IBM Watson analytics together.

We have been hard at work on a cool new addition to the OpenWhisk platform, the OpenWhisk Web Editor.

If you’re just tuning in, OpenWhisk is a serverless platform for hosting your applications. Using OpenWhisk, you can host your mobile, IoT, and web backends without worrying about deploying and maintaining servers. You can also use OpenWhisk to automate server-side processing of events. See the official announcement for more details about the core of OpenWhisk.

In this post, we introduce the OpenWhisk Editor:

OpenWhisk Editor

Our new editor allows you to quickly get up to speed with the OpenWhisk programming model. Along with the editor we are also releasing the OpenWhisk Catalog Viewer. Check it out; it’s a great place to learn about the emerging OpenWhisk ecosystem of re-usable actions and triggers.

Watch the OpenWhisk Editor in Action

Quick Overview of the OpenWhisk Editor

Until now the Command Line Interface (CLI) has been the only tool for crafting your OpenWhisk application. The OpenWhisk Editor provides an alternative to the daunting flexibility of CLI by helping you accomplish three common tasks: writing new actions, composing your code with third-party offerings into larger applications, and automating the invocation of your code.

Task 1: Write and Debug New Code

Sometimes you need to bridge existing components together in a novel way. For example, you may need to align JSON schemas or implement custom logic for filtering or grouping. Perhaps you would like to use an analytical component that adds value to your application. In OpenWhisk, you create such bridging or analytic components by authoring a new Action:

An action that logs a message

To create a new action in the OpenWhisk Editor, you first click New Action. Next, write the code, keeping in mind that OpenWhisk actions take JSON as input, and return a JSON object as their output; and they can also call console.log to aid in debugging. After writing the new action, you can invoke it by clicking Run This Action. You will then see the output of your action presented in the Console section:


In OpenWhisk, since every action or feed you create automatically becomes a REST endpoint, you can call the REST endpoint directly via cURL. To see an example cURL invocation, click REST Endpoint:

REST endpoint

Task 2: Compose Your Code with Third Party Code

With OpenWhisk you can compose sequences by assembling a set of actions as inputs and outputs of each other. The result is a chain of actions that execute in the order you arrange them. You can start composing your sequence either from the blank composition interface or by selecting an existing action from the public catalog. For example, you may want a composition that uses IBM’s Watson analytics or The Weather Company’s weather forecast service. If this were your starting point, you would click on the one in Public Actions that interests you, displaying it in the Catalog Details view. Click Start a New Sequence to open the Sequence Editor already populated with your chosen public action—in this case, the weather forecast action:

Start a New Sequence
After clicking “Start a New Sequence”

After Dragging Action
After dragging your action

For more information, see Introducing the OpenWhisk Catalog Viewer. And in a future post, we will go through the process of binding and configuring third-party actions.

Continuing with the assembly of our sequence, drag any other action onto the canvas. You will see that you can form sequences of arbitrary length. Like UNIX pipes, OpenWhisk action sequences automatically feed each output as input to the next action. For example, you can personalize a weather forecast by having the next action in the sequence take the output of the general weather forecast action and filter it to present only tomorrow’s high temperature.

Finally, to invoke the sequence you composed, simply click Run This Sequence.

Task 3: Automate Your Compositions

We have learned how to manually invoke an action and sequence.

You can also schedule OpenWhisk to invoke your creations by using a public feed. For example, start a new sequence by selecting the alarm feed from the Public Feeds section of the catalog. Let’s say you want the sequence to kick off every minute:

Periodic Weather
Periodic Weather Forecast

The alarms feed will execute whatever actions you connect to it in the sequence, turning the feed into a trigger for your actions. Using cron notation, configure the feed to kick off the sequence at whatever internal you want.

Add Comment
One Comment

Leave a Reply

Your email address will not be published.Required fields are marked *


strange tool. nothing happens when i click “Run”. My function does not appear on the left side… either this is a bug or the tutorial is missing some important things…

More Compute Services Stories

Cloud Foundry Day – London England, Nov 29th

Come join us for a "Cloud Foundry Day", a free educational conference and networking event with talks by Cloud Foundry community members, industry leaders, and Cloud Foundry Developers. Hosted by Dr. Julian Friedman, IBM Open Source Development Lead, code contributor and a leader in the Cloud Foundry community, and joined by renown speakers in the Cloud Foundry community. Enjoy some great topics, good conversations, food and beer!

Continue reading

WEBINAR: Join IBM Cloud and F5 on Nov 15 for “Multi-Cloud Made Easy”

One of the greatest strengths of IBM Cloud’s partnership with VMware is our expanding ecosystem of best-in-class partners. F5 is the newest member of this alliance. In addition to IBM Cloud’s global reach – an unparalleled 60 data centers worldwide and growing, flexible purchase and deployment options for IBM Cloud for VMware Solutions and extensive […]

Continue reading

Protect your data to simplify GDPR Readiness

The EU General Data Protection Regulation will come in force in May 2018, everyone is in a scurry to get ready and get ready fast. The GDPR brings with it potential fines for non compliance but also brings an opportunity for businesses to enhance their business and brand value. We see our customers are interested in two aspects. First, what is IBM doing for their own GDPR readiness, we recently published our own readiness journey. The second aspect is what IBM can do to help clients with their readiness program?

Continue reading