Skip to content
Weik.ioDocs
2026.1
Try Weik.io

This page describes Weik.io 2026.1, and the current release is 2026.2. Weik.io 2026.2 docs

Notebooks

Weik.io 2026.1

Create interactive automation workflows with notebooks.

On this page

Notebooks combine code, documentation, and execution results in a single document. The concept is similar to Jupyter Notebooks.

Why use Notebooks?#

Notebooks let you run and inspect code step by step. They are interactive documents where you can:

  • Write and execute code in isolated cells
  • Document your thought process with Markdown
  • See the output immediately below your code
  • Test workflows interactively without running a full script

They suit scenarios where you need to explore an API, inspect the data, transform it, and check the results before writing the final automation.

Key features#

  • Interactive execution: Run a single code cell to test a change without restarting the whole process.
  • Multiple languages: Notebooks support C#, Python, JavaScript, and other languages.
  • Rich output: Render tables, charts, and formatted data inline.
  • Version control: Changes are tracked over time.

Creating notebooks#

  1. Go to Automation > Notebooks.
  2. Click Add… to create a new notebook.
  3. Give it a name and start adding code and Markdown cells.

Structure#

A notebook is a sequence of cells:

Code cells These run your logic. When you execute a cell, the output appears below it. Variables and state from previous cells carry over, so you can fetch data in one cell and manipulate it in the next.

Markdown cells Use these to document the notebook for yourself or your team. Explain why the code takes a particular approach, or document the expected data format.

Real-world uses#

Data analysis#

Fetch data from an API and analyze it:

// Fetch data from API
var data = await api.GetOrders();

// Analyze
var totalRevenue = data.Sum(o => o.Amount);
var avgOrderValue = data.Average(o => o.Amount);

// Display results
Display($"Total Revenue: {totalRevenue:C}");
Display($"Average Order: {avgOrderValue:C}");

Prototyping workflows#

Before deploying a full integration, you can test the data transformation interactively:

// Test data transformation
var input = LoadSampleData();
var transformed = TransformData(input);

// Validate output
Assert.Equal(expected, transformed);
Display("Transformation validated successfully");

One-off operational tasks#

Run a script once to fix a problem or check system health:

// Check system health
var health = await CheckSystemHealth();

// Generate report
var report = CreateHealthReport(health);

// Send notification if issues found
if (health.HasIssues)
{
    await SendAlert(report);
}

Data migrations#

Notebooks work well for migrations: load a small batch of legacy data, test the transformation, verify the output, and only then run the full migration.

// Load source data
var sourceData = await LoadFromLegacySystem();

// Transform for new system
var transformed = TransformForNewSchema(sourceData);

// Validate before migration
ValidateData(transformed);

// Migrate to new system
await MigrateData(transformed);

Display($"Migrated {transformed.Count} records");

Running your code#

The following execution options are available:

  • Run Cell: Executes only the current code cell.
  • Run All: Runs all cells from top to bottom.
  • Restart & Run All: Clears all variables and state from memory, then runs all cells.
  • Schedule: Runs the notebook on a cron schedule, like a scheduled task.

Platform context#

Notebooks can access the rest of the Weik.io platform:

Triggering integrations

// Get a specific integration flow
var flow = await Integrations.GetFlow("my-flow");

// Run it directly from the notebook
var result = await flow.Execute(data);

Using variables Avoid hardcoding credentials in notebooks.

// Read from platform variables
var apiKey = Variables.Get("API_KEY");

var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", apiKey);

Publishing events

// Publish an event that other systems can react to
await Events.Publish(new OrderCreatedEvent
{
    OrderId = order.Id,
    CustomerId = order.CustomerId,
    Amount = order.Amount
});

Scheduling#

To run a notebook as a recurring job, schedule it without rewriting it:

  1. Go to the notebook’s details page.
  2. Click Schedule.
  3. Set the cron expression and notification preferences.

Best practices#

Explain the “why” Use Markdown cells to explain why the code exists and document its assumptions, so others can run the notebook later without additional context.

Keep notebooks focused A notebook with many cells doing several different jobs is difficult to debug. Break complex workflows into separate notebooks.

Test failure states Interactive development makes it easy to test only the successful path. Verify what happens when the API returns an error or a database query times out.

try
{
    var result = await ExecuteOperation();
    Display($"Success: {result}");
}
catch (Exception ex)
{
    Logger.Error("Operation failed", ex);
    await SendAlert($"Notebook failed: {ex.Message}");
    
    // Throwing here ensures the platform registers the execution as a failure
    throw;
}

Next steps#