Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@jacobweinstock
Copy link
Member

Description

There are no breaking changes in this PR. This fixes a typo in the Workflow status API: templateRending -> templateRendering. This also implements multi-task, multi-agent Workflows. The example below shows a Template with 2 tasks that are assigned to 2 different Agents.

apiVersion: tinkerbell.org/v1alpha1
kind: Template
metadata:
  name: multi-agent
spec:
  data: |
    name: multi-agent
    global_timeout: 90
    tasks:
      - name: "first task"
        worker: "{{.agent2}}"
        actions:
          - name: "action 1"
            image: alpine
            timeout: 60
            command: ["sleep", "4"]
      - name: "second task"
        worker: "{{.agent2}}"
        actions:
          - name: "action 1"
            image: alpine
            timeout: 60
            command: ["sleep", "4"]

Here's the corresponding Workflow:

apiVersion: "tinkerbell.org/v1alpha1"
kind: Workflow
metadata:
  name: multi-agent
spec:
  templateRef: multi-agent
  hardwareMap:
    agent1: "1234"
    agent2: "5678"

Why is this needed

Fixes: #

How Has This Been Tested?

How are existing users impacted? What migration steps/scripts do we need?

Checklist:

I have:

  • updated the documentation and/or roadmap (if required)
  • added unit or e2e tests
  • provided instructions on how to upgrade

templateRending -> templateRendering

Signed-off-by: Jacob Weinstock <[email protected]>
This is required by the spec.

Signed-off-by: Jacob Weinstock <[email protected]>
@jacobweinstock jacobweinstock requested a review from Copilot August 16, 2025 17:38
@jacobweinstock jacobweinstock changed the title Implement multi-task multi-agent Workflows Implement multi-task multi-agent functionality in Workflows Aug 16, 2025

This comment was marked as outdated.

Signed-off-by: Jacob Weinstock <[email protected]>
@jacobweinstock jacobweinstock requested a review from Copilot August 16, 2025 17:53

This comment was marked as outdated.

Signed-off-by: Jacob Weinstock <[email protected]>
@jacobweinstock jacobweinstock requested a review from Copilot August 16, 2025 18:00

This comment was marked as outdated.

Signed-off-by: Jacob Weinstock <[email protected]>
@jacobweinstock jacobweinstock requested a review from Copilot August 16, 2025 18:03

This comment was marked as outdated.

Signed-off-by: Jacob Weinstock <[email protected]>
Signed-off-by: Jacob Weinstock <[email protected]>
@jacobweinstock jacobweinstock requested a review from Copilot August 16, 2025 18:06
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements multi-task multi-agent functionality in Workflows while fixing a typo in the template rendering field name. The main changes enable workflows to handle tasks assigned to different agents and properly transition between them.

  • Implements logic to detect when a workflow should transition between tasks with different agents
  • Adds comprehensive tests for multi-agent workflow scenarios
  • Fixes the field name from templateRending to templateRendering across API definitions and CRDs

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
reconciler.go Adds updateAgentIDIfNeeded function and integrates agent transition logic into reconciliation
reconciler_test.go Comprehensive test suite for agent ID updates and multi-task workflow scenarios
workflow.go Fixes typo in API struct field name and kubebuilder annotation
tinkerbell.org_workflows.yaml Updates CRD field names to match corrected API

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@jacobweinstock jacobweinstock added the ready-to-merge Signal Mergify to merge the PR label Aug 16, 2025
@mergify mergify bot merged commit a6e8bf0 into tinkerbell:main Aug 16, 2025
12 checks passed
@jacobweinstock jacobweinstock deleted the multi-task-multi-agent branch August 17, 2025 21:53
elauriault pushed a commit to elauriault/tinkerbell that referenced this pull request Oct 17, 2025
…ll#330)

## Description


There are no breaking changes in this PR. This fixes a typo in the Workflow status API: `templateRending` -> `templateRendering`. This also implements multi-task, multi-agent Workflows. The example below shows a Template with 2 tasks that are assigned to 2 different Agents.

```yaml
apiVersion: tinkerbell.org/v1alpha1
kind: Template
metadata:
  name: multi-agent
spec:
  data: |
    name: multi-agent
    global_timeout: 90
    tasks:
      - name: "first task"
        worker: "{{.agent2}}"
        actions:
          - name: "action 1"
            image: alpine
            timeout: 60
            command: ["sleep", "4"]
      - name: "second task"
        worker: "{{.agent2}}"
        actions:
          - name: "action 1"
            image: alpine
            timeout: 60
            command: ["sleep", "4"]
```

Here's the corresponding Workflow:

```yaml
apiVersion: "tinkerbell.org/v1alpha1"
kind: Workflow
metadata:
  name: multi-agent
spec:
  templateRef: multi-agent
  hardwareMap:
    agent1: "1234"
    agent2: "5678"
```

## Why is this needed



Fixes: #

## How Has This Been Tested?





## How are existing users impacted? What migration steps/scripts do we need?





## Checklist:

I have:

- [ ] updated the documentation and/or roadmap (if required)
- [ ] added unit or e2e tests
- [ ] provided instructions on how to upgrade
elauriault pushed a commit to elauriault/tinkerbell that referenced this pull request Oct 18, 2025
…ll#330)

## Description


There are no breaking changes in this PR. This fixes a typo in the Workflow status API: `templateRending` -> `templateRendering`. This also implements multi-task, multi-agent Workflows. The example below shows a Template with 2 tasks that are assigned to 2 different Agents.

```yaml
apiVersion: tinkerbell.org/v1alpha1
kind: Template
metadata:
  name: multi-agent
spec:
  data: |
    name: multi-agent
    global_timeout: 90
    tasks:
      - name: "first task"
        worker: "{{.agent2}}"
        actions:
          - name: "action 1"
            image: alpine
            timeout: 60
            command: ["sleep", "4"]
      - name: "second task"
        worker: "{{.agent2}}"
        actions:
          - name: "action 1"
            image: alpine
            timeout: 60
            command: ["sleep", "4"]
```

Here's the corresponding Workflow:

```yaml
apiVersion: "tinkerbell.org/v1alpha1"
kind: Workflow
metadata:
  name: multi-agent
spec:
  templateRef: multi-agent
  hardwareMap:
    agent1: "1234"
    agent2: "5678"
```

## Why is this needed



Fixes: #

## How Has This Been Tested?





## How are existing users impacted? What migration steps/scripts do we need?





## Checklist:

I have:

- [ ] updated the documentation and/or roadmap (if required)
- [ ] added unit or e2e tests
- [ ] provided instructions on how to upgrade
elauriault pushed a commit to elauriault/tinkerbell that referenced this pull request Oct 18, 2025
…ll#330)

## Description


There are no breaking changes in this PR. This fixes a typo in the Workflow status API: `templateRending` -> `templateRendering`. This also implements multi-task, multi-agent Workflows. The example below shows a Template with 2 tasks that are assigned to 2 different Agents.

```yaml
apiVersion: tinkerbell.org/v1alpha1
kind: Template
metadata:
  name: multi-agent
spec:
  data: |
    name: multi-agent
    global_timeout: 90
    tasks:
      - name: "first task"
        worker: "{{.agent2}}"
        actions:
          - name: "action 1"
            image: alpine
            timeout: 60
            command: ["sleep", "4"]
      - name: "second task"
        worker: "{{.agent2}}"
        actions:
          - name: "action 1"
            image: alpine
            timeout: 60
            command: ["sleep", "4"]
```

Here's the corresponding Workflow:

```yaml
apiVersion: "tinkerbell.org/v1alpha1"
kind: Workflow
metadata:
  name: multi-agent
spec:
  templateRef: multi-agent
  hardwareMap:
    agent1: "1234"
    agent2: "5678"
```

## Why is this needed



Fixes: #

## How Has This Been Tested?





## How are existing users impacted? What migration steps/scripts do we need?





## Checklist:

I have:

- [ ] updated the documentation and/or roadmap (if required)
- [ ] added unit or e2e tests
- [ ] provided instructions on how to upgrade
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api ready-to-merge Signal Mergify to merge the PR tink-controller

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant