Kernel is a flexible cloud platform that enables you to deploy and execute code without managing infrastructure. With Kernel, you can take your code from local development to production in seconds.

Apps, Actions, and Invocations

An App is the codebase deployed on Kernel. You can use Kernel for a variety of use cases, including web automation, data processing, AI agents, and more.

An Action is an invokable method within an app. Actions allow your to register entry points or functions that can be triggered on-demand. Actions can call non-action methods. Apps can have multiple actions.

An Invocation is a single execution of an action. Invocations can be triggered via API, scheduled as a job, or run on-demand.

Getting started: create an app

First, install the Kernel SDK and create an app.

import { Kernel } from '@onkernel/sdk';

const kernel = new Kernel();
const app = kernel.app('my-app-name');

Then, define and register an action that you want to invoke:

// Define a method called `myActionMethod` and register it as an action
app.action("my-action-name", myActionMethod);

Parameters

Action methods receive two parameters:

  • runtimeContext: Contextual information provided by Kernel during execution
  • payload: Optional runtime data that you provide when invoking the action. Read more

This consistent interface ensures your code runs identically in both local and production environments, enabling seamless integration across development and deployment.

const myActionMethod = async (runtimeContext, payload) => {
  const { tshirt_size, color, shipping_address } = payload;
  // ...
};

Environment variables

Set environment variables when deploying your app. They then can be accessed in the usual way:

const ENV_VAR = process.env.ENV_VAR;
const myActionMethod = async (runtimeContext, payload) => {
  // ...
};

Return values

Action methods can return values, which will be returned in its invocation’s final response.

const myActionMethod = async (runtimeContext, payload) => {
  const { tshirt_size, color, shipping_address } = payload;
  // ...
  return {
    order_id: "example-order-id",
  }
};

Example Use Cases

Kernel’s flexible, fast platform enables a wide range of applications:

  • Web Automation: Create browser-based workflows using Playwright or Puppeteer
  • API Integration: Build middleware services connecting different systems
  • AI Agents: Deploy and orchestrate autonomous agents
  • Data Processing: Run data processing jobs

For specific implementation details about writing browser automations, read our Browser Frameworks guide.

Once you’re happy with your app, follow these steps to deploy and invoke it on the Kernel platform.