This repository was archived by the owner on Jan 28, 2026. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
✨ Small workflow updates #1018
Merged
Merged
✨ Small workflow updates #1018
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
1a67336
✨ Sort
asim-shrestha ae519d5
✨ Link
asim-shrestha d706d28
✨ Init
asim-shrestha f3910b6
✨ Update schema
asim-shrestha ebe5eea
✨ Status Check
asim-shrestha ad262e0
✨ Update
asim-shrestha 454c9ce
✨ Hide rightside bar if not defined
asim-shrestha 1cda3db
✨ Add workflow dashboard
asim-shrestha 5d5ab7b
✨ Make right sidebar dynamic in dashboard
asim-shrestha 0d17647
✨ Fix index dashboard
asim-shrestha 6ec43fd
✨ Update AuthItem
asim-shrestha 65f31c5
✨ Add Workflow side bar
asim-shrestha 52bdf58
Merge branch 'main' into exec_3
asim-shrestha f5cef65
✨ Remove links
asim-shrestha 6413d7a
✨ Fix mypy
asim-shrestha 8d25667
✨ Fix mypy
asim-shrestha 9e00b6c
✨ Update prisma schema
asim-shrestha 5de604e
✨ FIX
asim-shrestha e6df2c7
✨ Update schemas
asim-shrestha 8396efd
✨ Fix URL check types
asim-shrestha 94eac7d
✨ Add workflow docs
asim-shrestha cc49ba7
✨ Remove super
asim-shrestha 1a79225
✨ Update
asim-shrestha 8fd4f26
✨ Update
asim-shrestha 38f73c1
✨ Update useSqlite
asim-shrestha 4fa7428
✨ Update definition
asim-shrestha 4662530
✨ Curry createNode
asim-shrestha e34a717
✨ Front end display node block types
asim-shrestha ae3e9ef
✨ Front end display node block types
asim-shrestha 8448c71
Merge branch 'main' into exec_3
asim-shrestha f579673
✨ Fix build issues
asim-shrestha e69ca28
✨ Fix sidebar
asim-shrestha File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| --- | ||
| title: "Workflows" | ||
| description: The workflow automation system within AgentGPT. | ||
| icon: "wave-sine" | ||
| --- | ||
|
|
||
| A core function of Reworkd is AI powered workflow automation. This documentation covers key concepts within our workflow platform. | ||
|
|
||
| ## Frontend models | ||
| The workflow hierarchy follows a graph-like structure. The frontend models only prescribe the front-end view of the workflow. | ||
|
|
||
| - A workflow is the graph itself. It represents the workflow in its entirety | ||
| - A node is a single element within a workflow. It has a position | ||
| - An edge represents a connection between two nodes of a workflow | ||
|
|
||
| ## Backend models | ||
| The backend models represent the mechanisms to actually perform work for a given node. | ||
| Each frontend `Node` will have an associated `Block`. | ||
| `Node` represents the frontend view / position while the `Block` represents what will actually happen when that `Node` is run. | ||
| For example, a "SlackMessageBlock" is a `Block` that, when executed, would send a user a message on "Slack". | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| import type { DisplayProps } from "./Sidebar"; | ||
| import Sidebar from "./Sidebar"; | ||
| import React from "react"; | ||
| import { FaBars } from "react-icons/fa"; | ||
| import type { NodeBlockDefinition } from "../../services/workflow/node-block-definitions"; | ||
| import { getNodeBlockDefinitions } from "../../services/workflow/node-block-definitions"; | ||
| import type { createNodeType } from "../../hooks/useWorkflow"; | ||
|
|
||
| type WorkflowControls = { | ||
| createNode: createNodeType; | ||
| }; | ||
|
|
||
| type WorkflowSidebarProps = DisplayProps & WorkflowControls; | ||
|
|
||
| // Wrapper HOC to curry the createNode function | ||
| export const getWorkflowSidebar = (createNode: createNodeType) => { | ||
| const WorkflowSidebarHOC = ({ show, setShow }: DisplayProps) => ( | ||
| <WorkflowSidebar show={show} setShow={setShow} createNode={createNode} /> | ||
| ); | ||
| WorkflowSidebarHOC.displayName = "WorkflowSidebarHOC"; | ||
| return WorkflowSidebarHOC; | ||
| }; | ||
|
|
||
| const WorkflowSidebar = ({ show, setShow, createNode }: WorkflowSidebarProps) => { | ||
| return ( | ||
| <Sidebar show={show} setShow={setShow} side="right"> | ||
| <div className="text-color-primary flex h-screen flex-col gap-2"> | ||
| <div className="flex flex-row items-center gap-1"> | ||
| <button | ||
| className="neutral-button-primary rounded-md border-none transition-all" | ||
| onClick={() => setShow(!show)} | ||
| > | ||
| <FaBars size="15" className="z-20 m-2" /> | ||
| </button> | ||
| <div className="ml-5 font-bold">Block</div> | ||
| </div> | ||
| {getNodeBlockDefinitions().map((nodeBlockDefinition) => ( | ||
| <NodeBlock | ||
| key={nodeBlockDefinition.type} | ||
| definition={nodeBlockDefinition} | ||
| createNode={createNode} | ||
| /> | ||
| ))} | ||
| </div> | ||
| </Sidebar> | ||
| ); | ||
| }; | ||
|
|
||
| type NodeBlockProps = { | ||
| definition: NodeBlockDefinition; | ||
| createNode: createNodeType; | ||
| }; | ||
| const NodeBlock = ({ definition, createNode }: NodeBlockProps) => { | ||
| return ( | ||
| <div | ||
| className="flex cursor-pointer flex-row gap-2 rounded-md border border-white/20 p-2 hover:bg-white/10" | ||
| onClick={() => createNode(definition)} | ||
| > | ||
| <div className="h-[30px] w-[30px]"> | ||
| <img src={definition.image_url} alt={definition.type} width={30} /> | ||
| </div> | ||
| <div> | ||
| <h3 className="font-medium">{definition.type}</h3> | ||
| <p className="text-sm font-thin">{definition.description}</p> | ||
| </div> | ||
| </div> | ||
| ); | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| import { z } from "zod"; | ||
|
|
||
| export const NodeBlockDefinitionSchema = z.object({ | ||
| type: z.string(), | ||
| description: z.string(), | ||
| image_url: z.string(), | ||
| }); | ||
|
|
||
| export type NodeBlockDefinition = z.infer<typeof NodeBlockDefinitionSchema>; | ||
|
|
||
| const UrlStatusCheckBlockDefinition: NodeBlockDefinition = { | ||
| type: "UrlStatusCheck", | ||
| description: "Check the status of a URL", | ||
| image_url: "/tools/web.png", | ||
| }; | ||
|
|
||
| export const getNodeBlockDefinitions = () => { | ||
| return [UrlStatusCheckBlockDefinition]; | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
31 changes: 31 additions & 0 deletions
31
platform/reworkd_platform/web/api/workflow/blocks/web/status_check.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| from typing import Optional | ||
|
|
||
| import requests | ||
| from requests import RequestException | ||
|
|
||
| from reworkd_platform.web.api.workflow.schemas import Block, BlockIOBase | ||
|
|
||
|
|
||
| class UrlStatusCheckBlockInput(BlockIOBase): | ||
| url: str | ||
|
|
||
|
|
||
| class UrlStatusCheckBlockOutput(BlockIOBase): | ||
| code: Optional[int] | ||
|
|
||
|
|
||
| class UrlStatusCheckBlock(Block): | ||
| type = "UrlStatusCheckNode" | ||
| description = "Outputs the status code of a GET request to a URL" | ||
| image_url = "" | ||
| input_config: UrlStatusCheckBlockInput | ||
|
|
||
| def run(self) -> BlockIOBase: | ||
| try: | ||
| response = requests.get(self.input_config.url) | ||
| code = response.status_code | ||
| except RequestException: | ||
| code = None | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. might be good to log something?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah we need better logging throughout |
||
|
|
||
| output = UrlStatusCheckBlockOutput(code=code) | ||
| return output | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.