# Quickstart

# Overview

The quickstart guide will walk you through building and publishing your first application; here, you will:

  1. Create and configure an application
  2. Publish your application
  3. Share and run the tool through the Run console

# Creating an application

When you first log into your CloudWright organization, you'll see be prompted to either try out an example Application or to create a new, blank one. Feel free to run and edit the example applications -- but for this quickstart, we'll be creating a new Application from scratch.

First Login

Click the 'Applications' tab in the left sidebar. This will take you to a list of all applications you have permission to view. On a new instance, you'll see example Applications, but no personal Applications (yet).

Blank Applications

Click on 'New' to create a new application. For this Quickstart, leave the application 'Personal', and in the 'CloudWright Managed' development zone. (For a deeper explanation of those choices, see Applications). 'Save' will initialize this application.

New App

Creating the application will jump you into the Cloud IDE web-editor. For now, click 'Get Started' to start writing code.

Blank App

To help you get started, this gives you a 'Hello World' application with inputs and outputs defined.

Template App

Let's walk through the starter code:

my_input = CloudWright.inputs.get("input1")

Here, we've declared an input to our application. Named inputs to your application will tell users of your app what the expected inputs are.

print("my_input = " + str(my_input))

Logging works like normal Python code. We can print this variable for debugging or utility output.

For now, we'll skip over the 'Hello World' module calls. Modules are powerful hooks which add pre-configured connections and libraries to your application. For more details on modules and how to use them, see the Modules section.

CloudWright.response.set_value({"my_output": "my_output_value", "my_input": my_input})

Every CloudWright application has the option of writing to a response which will be directly returned to callers — think of a response as the value a function returns.

Some applications you wite will have modules which return their important output via side-effects, like writing to an S3 file — in those cases, it's totally OK to return a write a simple response, or no response at all.

Feel free to edit this code if you want, but the starter code is ready to run as-is. Click the blue 'Run' button in the lower left to run this starter code:

Dry Run Blank

Our response is just what we'd expect — my_input is blank:

{
  "my_input": "",
  "my_output": "my_output_value"
}

If we run with a custom input though, we'll get the value back in our response:

Dry Run Custom

We could make our application do fancier things with custom modules, but for now let's just publish and run this code as-is.

# Deploying and running

We were able to test our code in real-time while editing our application, but to share the application with other users or invoke it via Triggers, we have to publish it first. Publish an application by opening the 'Publish' tab in the right sidebar and clicking 'Publish':

Publish

After confirming that we want to publish our application, it will take a couple minutes to publish our application. You can watch the progress by clicking on the spinner icon.

Once your application is done publishing, it's ready to be run. If you navigate back to the 'Applications' tab, you'll see that the name of your application is a link

Run

Click it to enter the Run console.

Run

The Run console is the simplest way to run a published application with a specific set of inputs (for other ways of calling an application, see Triggers). It's also where we can go to track successes and failures of our application.

We'll use this dialog to kick off a custom run of our application, by providing custom inputs:

Run

If we wanted to save these inputs to re-run the application later, we could do it here. For now, just 'Run' without saving the input:

Run

On the History page, we can track progress of the application. If you haven't run an application for a couple hours, it might take a few seconds to launch (if you run an application frequently, it will start instantly). The History page will update automatically when the application finishes:

Run

To see the output from our application, click 'View'. Here, we can see both function's output and the inputs we provided.

Run

That's all it takes to share and run an application! For applications you'd rather programatically invoke — for example, via an HTTP endpoint — check out the guide to setting up custom Triggers.