Implement persistent background agent execution with scheduling and event-driven triggers#1
Merged
Bharani010 merged 5 commits intoNov 3, 2025
Conversation
…and database migration Co-authored-by: Bharani010 <159679943+Bharani010@users.noreply.github.com>
Co-authored-by: Bharani010 <159679943+Bharani010@users.noreply.github.com>
Co-authored-by: Bharani010 <159679943+Bharani010@users.noreply.github.com>
Co-authored-by: Bharani010 <159679943+Bharani010@users.noreply.github.com>
Copilot
AI
changed the title
Feature Request
Enhance Langflow Agents to support persistent background execution, ensuring they remain active even when the UI is closed or user is offline. Agents should operate as dedicated background processes/services, enabling scheduled, event-d...
Implement persistent background agent execution with scheduling and event-driven triggers
Nov 3, 2025
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Enables agents to run autonomously without UI dependency, supporting scheduled execution (cron/interval/date), webhook triggers, and event-driven workflows.
Implementation
Database Layer
BackgroundAgentmodel: stores agent config, trigger settings, status (ACTIVE/PAUSED/STOPPED/ERROR)BackgroundAgentExecutionmodel: tracks execution history with results and errorsService Layer
BackgroundAgentService: APScheduler-based service managing agent lifecyclestart_agent(),stop_agent(),pause_agent(),resume_agent(),trigger_agent()execute_flow_background()using existingFlowRunnerAPI Endpoints
13 new endpoints under
/api/v1/background_agents/:POST /,GET /,GET /{id},PATCH /{id},DELETE /{id}POST /{id}/start,POST /{id}/stop,POST /{id}/pause,POST /{id}/resumePOST /{id}/trigger,GET /{id}/status,GET /{id}/executionsUsage Example
Dependencies
APScheduler>=3.10.4,<4.0.0for scheduling infrastructureTesting
Documentation
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.