Workflows are Shinkai Tools developed to streamline complex processes. They help users efficiently manage various AI-related operations by connecting multiple steps into one smooth flow.

This feature is particularly helpful for users who want to optimize their tasks without needing to handle every step individually.

Shinkai comes with a variety of pre-created workflows that you can browse directly in Shinkai’s wokflow library.

Why Use the Shinkai Workflow Playground?

  • Efficiency: Create, test, and refine workflows faster.
  • Flexibility: Customize your agents’ behaviors without needing deep technical knowledge.
  • Seamless Integration: Easily connect your workflows with APIs and external services through function calls.
  • Scalability: Build workflows that can handle complex, multi-step processes.

Workflow Playground Overview

Let’s review the Workflow Playground’s UI to help you navigate it with ease.

Building Custom Workflows

The Shinkai Workflow Playground is a user-friendly interface where you can define, test, and iterate workflows for your AI agents. It leverages the Shinkai DSL, a language designed specifically for building sequences of tasks that your agents can perform.

Shinkai’s DSL

Shinkai’s Domain-Specific Language (DSL) is designed to help you easily create workflows that guide an AI agent through a series of tasks. Here’s a quick step-by-step guide on how to use it.

How to write a workflow with DSL

1

Defining a workflow

Every workflow starts with workflow, followed by its name and version.

Example
workflow WebProcess v0.1 {
    // steps go here
}
2

Adding Steps

Each step starts with the word step followed by the step name.

Example
step Initialize {
    $PROMPT = "You are an expert summarizer..."
}
3

Using Registers (Variables)

Registers (variables) store information. They start with $. Example:

  • $PROMPT stores a string.
  • $CONTENT stores downloaded data.
Example
    $PROMPT = "Summarize the webpage content"
4

Calling External Functions

External functions let you use pre-built commands to perform tasks, like downloading data or processing information. The function is called with call.

Example
    $CONTENT = call download_webpage_and_save_as_markdown($INPUT)
5

Conditions

Use if statements to run actions only when certain conditions are met.

Example
if $TRANSACTION.value > 100 {
    // actions go here
}
6

Loops

Use for loops to repeat actions for a list of items.

Example
for $item in $list {
    // actions go here
}

Example Workflow

Here’s a complete example of a workflow that initializes a task, downloads webpage data, and summarizes it:

workflow WebProcess v0.1 {
    step Initialize {
        $PROMPT = "You are an expert summarizer. Summarize the webpage content in markdown format."
    }
    step Download {
        $CONTENT = call download_webpage_and_save_as_markdown($INPUT)
    }
    step Summarize {
        $RESULT = call inference($PROMPT, $CONTENT)
    }
}

In this example:

  • Step 1 (Initialize): Sets up the task with a prompt for the AI.
  • Step 2 (Download): Downloads webpage content using an external function.
  • Step 3 (Summarize): Uses the AI to summarize the content based on the prompt.

By following these simple guidelines, you can easily create powerful workflows with Shinkai DSL!

Enabling/Disabling Workflows

Workflows can be enabled and disabled at convenience. To do this, simply go to Shinkai Tools, browse the list and switch the toggle on/off to enable/disable them.