> ## Documentation Index
> Fetch the complete documentation index at: https://kwala.network/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Kwalang language

> Learn the fundamentals of YAML, the workflow definition language

Kwala workflows are defined using YAML, a human-readable data serialization language. Kwala uses YAML for several reasons:

* **Human-readable**: YAML's clean, indentation-based syntax makes workflows easy to read and understand without deep technical expertise.
* **Declarative**: Instead of writing imperative code that describes how to accomplish tasks, YAML allows developers to declare what should happen.
* **No-code accessibility**: YAML eliminates the need to write traditional backend code. Developers familiar with JSON, configuration files, or basic programming can create blockchain automation without learning a new programming language.
* **Standardized**: YAML is a widely adopted standard used across DevOps, CI/CD pipelines, and infrastructure-as-code tools.

## What makes Kwalang different

Kwalang eliminates the complexity of blockchain automation by providing a declarative language where you simply define what should happen and when. In Kwalang, you write workflows in YAML that specify:

* **When** your workflow should activate (triggers)
* **What** conditions must be met (optional conditional logic)
* **How** actions should execute (sequential or parallel)
* **Where** actions should run (which blockchain networks or APIs)

## Kwala's YAML structure

Kwala workflows use a simple key-value pair format to organize information. Think of it like a form where each field has a label (the key) and an answer (the value). This makes workflows easy to read and understand.

A key-value pair is written as: `Key: value`

The **key** is the label that describes what information you are providing. The **value** is the actual information. For example:

```yaml theme={null}
Name: my_token_monitor
ChainID: 1
```

Here, `Name` and `ChainID` are keys, and `my_token_monitor` and `1` are their corresponding values.

### Organize information with sections

Kwala workflows organize related information into sections. Each section groups together related key-value pairs. The main sections are:

* **Name**: The identifier for your workflow
* **Trigger**: When and how your workflow activates
* **Actions**: What happens when the workflow runs
* **Execution**: How the actions should be processed

### Example YAML workflow

Let's break down a real Kwala workflow:

```yaml theme={null}
Name: token_transfer_monitor
```

This gives your workflow a name so you can identify it later.

```yaml theme={null}
Trigger:
  TriggerSourceContract: 0x49e833337ece7afe375e44f4e3e8481029218e5c
  TriggerChainID: 1
  TriggerEventName: Transfer(address,address,uint256)
```

Here, we tell Kwala what to watch for. In plain English: "Monitor contract 0x49e8...18e5c on Ethereum (chain 1) for Transfer events."

```yaml theme={null}
Actions:
  - Name: transfer_funds
    Type: call
    TargetContract: 0x0f51bb10119727a7e5ea3538074fb341f56b09ad
    TargetFunction: function transfer(address recipient,uint256 amount)
    TargetParams:
      - 0x49e833337ece7afe375e44f4e3e8481029218e5c
      - 100
    ChainID: 1
```

Here, we tell Kwala what to do when triggered. In plain English: "Call the transfer function on contract 0x0f51...09ad and send 100 tokens to address 0x49e8...18e5c."

```yaml theme={null}
  - Name: notification_action
    Type: post
    APIEndpoint: https://workflow-notification-test.kalp.network/push_notification
    APIPayload:
      success: true
```

This sends a notification to an external service. In plain English: "Send a message to this URL confirming the action was successful."

```yaml theme={null}
Execution:
  Mode: sequential
```

Here, we specify the execution mode, telling Kwala to run each action one after another, waiting for each to complete before starting the next.

### Key patterns to remember

* **Indentation matters**: Items that belong together are indented (moved to the right). This shows their relationship. For example, all trigger-related information is indented under `Trigger:`.

* **Lists use dashes**: When you have multiple items of the same type (like multiple actions), each one starts with a dash `-`.

* **Values can be text, numbers, or addresses**: Kwala accepts different types of information depending on what the key needs.

* **NA means not applicable**: If a field does not apply to your workflow, you can use `NA` to indicate it is intentionally left empty.

<Card title="Next Steps" icon="arrow-right" href="/workflow-builder/create-workflow">
  Learn how to create your first workflow
</Card>
