Skip to content

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

feat(web): redesign the worker groups page (#16672)

moaaz786405fb4260
diff --git a/docs/install/reference/breaking-changes-unreleased.mdx b/docs/install/reference/breaking-changes-unreleased.mdx
index da5e414ab74..a7ca4e6d63a 100644
--- a/docs/install/reference/breaking-changes-unreleased.mdx
+++ b/docs/install/reference/breaking-changes-unreleased.mdx
@@ -8,6 +8,13 @@ Entries here move to [Breaking Changes](/install/reference/breaking-changes) aut
## What has changed?
+#### Worker group ids can no longer contain a colon
+
+Worker group ids with `:` in them are no longer routable. The assignment endpoints reject them, and a project or flow already assigned to such a group is treated as unassigned: its runs fall back to the project, platform or shared queue instead of the group's dedicated queue, and the group disappears from the worker groups page.
+
+#### What you need to do
+
+Rename any worker group whose id contains `:`: update `AP_WORKER_GROUP_ID` on its workers, then re-assign its projects and flows to the new name from the worker groups page.
#### GitHub 0.11.0: Update Repository (Agent) no longer makes private repositories public
When an AI agent used **Update Repository (Agent)** to change something else, such as the description, the agent path filled the three toggles it left out (**Private**, **Has Issues** and **Archived**) with `false` and sent them. Each such update could make a private repository public, turn off Issues and unarchive an archived repository. From GitHub 0.11.0 these three fields are dropdowns with **Yes**, **No** and **Leave unchanged**. A field the agent leaves out, or sets to Leave unchanged, is not sent, so the repository keeps its current setting.
diff --git a/packages/core/shared/package.json b/packages/core/shared/package.json
index 1a4e9c38c75..10a14685ecd 100644
--- a/packages/core/shared/package.json
+++ b/packages/core/shared/package.json
@@ -1,6 +1,6 @@
{
"name": "@activepieces/shared",
- "version": "0.204.0",
+ "version": "0.205.0",
"type": "commonjs",
"sideEffects": false,
"main": "./dist/src/index.js",
diff --git a/packages/core/shared/src/index.ts b/packages/core/shared/src/index.ts
index 9b342b63a32..4ad7640fa62 100755
--- a/packages/core/shared/src/index.ts
+++ b/packages/core/shared/src/index.ts
@@ -79,3 +79,4 @@ export * from './lib/ee/piece-set/required-actions-util'
export * from './lib/ee/piece-set/piece-set-config-util'
export * from './lib/ee/flow-approval'
export * from './lib/management/project/project-requests'
+export * from './lib/management/worker-group/worker-group-assignments'
diff --git a/packages/core/shared/src/lib/management/project/project-requests.ts b/packages/core/shared/src/lib/management/project/project-requests.ts
index 7e32bf5d528..26a94b55b61 100644
--- a/packages/core/shared/src/lib/management/project/project-requests.ts
+++ b/packages/core/shared/src/lib/management/project/project-requests.ts
@@ -16,8 +16,6 @@ export const UpdateProjectPlatformRequest = z.object({
}).optional(),
globalConnectionExternalIds: z.array(z.string()).optional(),
maxConcurrentJobs: z.optional(Nullable(z.number().int().positive())),
- /** @deprecated use POST /v1/worker-groups/projects/:id instead */
- workerGroupId: z.optional(Nullable(z.string())),
executionDataRetentionDays: z.optional(Nullable(z.number().int().positive())),
sensitive: z.boolean().optional(),
})
diff --git a/packages/core/shared/src/lib/management/worker-group/worker-group-assignments.ts b/packages/core/shared/src/lib/management/worker-group/worker-group-assignments.ts
new file mode 100644
index 00000000000..e6dd2560dc0
--- /dev/null
+++ b/packages/core/shared/src/lib/management/worker-group/worker-group-assignments.ts
@@ -0,0 +1,132 @@
+import { WorkerGroupScope } from '@activepieces/core-execution'
+import { ApId } from '@activepieces/core-utils'
+import { z } from 'zod'
+import { formErrors } from '../../form-errors'
+
+export const WORKER_GROUP_ASSIGNMENTS_MAX_PAGE_SIZE = 100
+export const WORKER_GROUP_BULK_ASSIGN_MAX_ITEMS = 500
+
+const WorkerGroupLabel = z.string().min(1).max(128)
+
+export const WorkerGroupSummary = z.object({
+ label: z.string(),
+ scope: z.enum([WorkerGroupScope.PROJECT, WorkerGroupScope.FLOW]),
+ online: z.number(),
+ slots: z.number(),
+ waiting: z.number(),
+ projectCount: z.number(),
+ flowCount: z.number(),
+ sample: z.array(z.string()),
+})
+export type WorkerGroupSummary = z.infer<typeof WorkerGroupSummary>
+
+export const WorkerGroupsOverview = z.object({
+ defaultGroup: z.object({
+ online: z.number(),
+ slots: z.number(),
+ projectCount: z.number(),
+ flowCount: z.number(),
+ sample: z.array(z.string()),
+ }),
+ groups: z.array(WorkerGroupSummary),
+})
+export type WorkerGroupsOverview = z.infer<typeof WorkerGroupsOverview>
+
+const PageQuery = {
+ search: z.string().max(100).optional(),
+ cursor: z.coerce.number().int().min(0).optional(),
+ limit: z.coerce.number().int().min(1).max(WORKER_GROUP_ASSIGNMENTS_MAX_PAGE_SIZE).default(50),
+ exclude: WorkerGroupLabel.optional(),
+}
+
+export const ListWorkerGroupProjectsRequest = z.object({
+ group: WorkerGroupLabel.optional(),
+ filter: z.enum(['all', 'shared']).optional(),
+ ...PageQuery,
+}).refine((request) => request.group !== undefined || request.filter !== undefined, {
+ message: formErrors.required,
+})
+export type ListWorkerGroupProjectsRequest = z.infer<typeof ListWorkerGroupProjectsRequest>
+
+export const ListWorkerGroupFlowsRequest = z.object({
+ group: WorkerGroupLabel.optional(),
+ filter: z.enum(['all', 'pinned']).optional(),
+ projectId: z.optional(ApId),
+ ...PageQuery,
+}).refine((request) => request.group !== undefined || request.filter !== undefined || request.projectId !== undefined, {
+ message: formErrors.required,
+})
+export type ListWorkerGroupFlowsRequest = z.infer<typeof ListWorkerGroupFlowsRequest>
+
+export const WorkerGroupProjectAssignment = z.object({
+ id: z.string(),
+ displayName: z.string(),
+ color: z.string(),
+ workerGroupId: z.string().nullable(),
+ maxConcurrentJobs: z.number().nullable(),
+ defaultMaxConcurrentJobs: z.number(),
+ flowCount: z.number(),
+ flowsElsewhere: z.number(),
+ pinnedFlows: z.array(z.object({
+ workerGroupId: z.string(),
+ count: z.number(),
+ })),
+})
+export type WorkerGroupProjectAssignment = z.infer<typeof WorkerGroupProjectAssignment>
+
+export const WorkerGroupFlowAssignment = z.object({
+ id: z.string(),
+ displayName: z.string(),
+ projectId: z.string(),
+ projectName: z.string(),
+ projectColor: z.string(),
+ enabled: z.boolean(),
+ workerGroupId: z.string().nullable(),
+ inherited: z.string().nullable(),
+ effective: z.string().nullable(),
+})
+export type WorkerGroupFlowAssignment = z.infer<typeof WorkerGroupFlowAssignment>
+
+export const WorkerGroupProjectAssignmentPage = z.object({
+ data: z.array(WorkerGroupProjectAssignment),
+ next: z.string().nullable(),
+ previous: z.string().nullable(),
+ offset: z.number(),
+ total: z.number(),
+})
+export type WorkerGroupProjectAssignmentPage = z.infer<typeof WorkerGroupProjectAssignmentPage>
+
+export const WorkerGroupFlowAssignmentPage = z.object({
+ data: z.array(WorkerGroupFlowAssignment),
+ next: z.string().nullable(),
+ previous: z.string().nullable(),
+ offset: z.number(),
+ total: z.number(),
+})
+export type WorkerGroupFlowAssignmentPage = z.infer<typeof WorkerGroupFlowAssignmentPage>
+
+export const AssignWorkerGroupProjectsRequest = z.object({
+ projects: z.array(ApId).min(1).max(WORKER_GROUP_BULK_ASSIGN_MAX_ITEMS),
+ workerGroupId: WorkerGroupLabel.nullable(),
+})
+export type AssignWorkerGroupProjectsRequest = z.infer<typeof AssignWorkerGroupProjectsRequest>
+
+export const AssignWorkerGroupFlowsRequest = z.object({
+ flows: z.array(ApId).min(1).max(WORKER_GROUP_BULK_ASSIGN_MAX_ITEMS),
+ workerGroupId: WorkerGroupLabel.nullable(),
+})
+export type AssignWorkerGroupFlowsRequest = z.infer<typeof AssignWorkerGroupFlowsRequest>
+
+export const MoveAllWorkerGroupRequest = z.object({
+ from: WorkerGroupLabel,
+ to: WorkerGroupLabel.nullable(),
+ scope: z.enum([WorkerGroupScope.PROJECT, WorkerGroupScope.FLOW]),
+})
+export type MoveAllWorkerGroupRequest = z.infer<typeof MoveAllWorkerGroupRequest>
+
+export const WorkerGroupMoveResult = z.object({
+ movedWaitingRuns: z.number(),
+ projects: z.array(z.string()),
+ flows: z.array(z.string()),
+})
+export type WorkerGroupMoveResult = z.infer<typeof WorkerGroupMoveResult>
diff --git a/packages/server/api/src/app/database/postgres-connection.ts b/packages/server/api/src/app/database/postgres-connection.ts
index 5e23fc25848..aa073a6b41d 100644
--- a/packages/server/api/src/app/database/postgres-connection.ts
+++ b/packages/server/api/src/app/database/postgres-connection.ts
@@ -452,8 +452,8 @@ import { AddPlatformModelTier1859000000000 } from './migration/postgres/18590000
import { AddPieceSetRequiredActions1860000000000 } from './migration/postgres/1860000000000-AddPieceSetRequiredActions'
import { AddEventDestinationEnabledAndFormat1862000000000 } from './migration/postgres/1862000000000-AddEventDestinationEnabledAndFormat'
import { AddEventDestinationHeaders1863000000000 } from './migration/postgres/1863000000000-AddEventDestinationHeaders'
-import { AddWorkerGroupIdToFlow1864000000000 } from './migration/postgres/1864000000000-AddWorkerGroupIdToFlow'
import { AddPlatformTierFastAndConversationTier1864000000000 } from './migration/postgres/1864000000000-AddPlatformTierFastAndConversationTier'
+import { AddWorkerGroupIdToFlow1864000000000 } from './migration/postgres/1864000000000-AddWorkerGroupIdToFlow'
import { AddAuditLogRetentionDaysToPlatform1865000000000 } from './migration/postgres/1865000000000-AddAuditLogRetentionDaysToPlatform'
import { AddAiSpecificModelsVisibleToPlatformConfiguration1866000000000 } from './migration/postgres/1866000000000-AddAiSpecificModelsVisibleToPlatformConfiguration'
import { AddAgentTask1867000000000 } from './migration/postgres/1867000000000-AddAgentTask'
diff --git a/packages/server/api/src/app/ee/projects/platform-project-service.ts b/packages/server/api/src/app/ee/projects/platform-project-service.ts
index 6d16f7c8d0f..efd87bdea5a 100644
--- a/packages/server/api/src/app/ee/projects/platform-project-service.ts
+++ b/packages/server/api/src/app/ee/projects/platform-project-service.ts
@@ -16,7 +16,6 @@ import { platformService } from '../../platform/platform.service'
import { ProjectEntity } from '../../project/project-entity'
import { applyProjectsAccessFilters, projectService } from '../../project/project-service'
import { userService } from '../../user/user-service'
-import { projectWorkerGroupService } from '../../workers/worker-groups/project-worker-group.service'
import { concurrencyPoolService } from '../platform/concurrency-pool/concurrency-pool.service'
import { platformPlanService } from '../platform/platform-plan/platform-plan.service'
import { projectMemberService } from './project-members/project-member.service'
@@ -129,7 +128,7 @@ export const platformProjectService = (log: FastifyBaseLogger) => ({
}: UpdateParams): Promise<ProjectWithLimits> {
const project = await projectService(log).getOneOrThrow(projectId)
const platformPlan = await platformPlanService(log).getOrCreateForPlatform(project.platformId)
- const { globalConnectionExternalIds, maxConcurrentJobs, workerGroupId, ...rest } = request
+ const { globalConnectionExternalIds, maxConcurrentJobs, ...rest } = request
let resolvedPoolId: string | null | undefined
await transaction(async (entityManager) => {
resolvedPoolId = await resolvePoolId({ platformId: project.platformId, projectId, maxConcurrentJobs, log })
@@ -194,13 +193,6 @@ export const platformProjectService = (log: FastifyBaseLogger) => ({
if (resolvedPoolId !== undefined) {
await concurrencyPoolService(log).assignProject({ projectId, poolId: resolvedPoolId })
}
- if (platformPlan.workerGroupsEnabled && workerGroupId !== undefined) {
- await projectWorkerGroupService(log).assignProjectToGroup({
- projectId,
- platformId: project.platformId,
- workerGroupId,
- })
- }
return this.getWithPlanAndUsageOrThrow(projectId)
},
async getWithPlanAndUsageOrThrow(
diff --git a/packages/server/api/src/app/project/project-service.ts b/packages/server/api/src/app/project/project-service.ts
index 8543a809be6..53cf7f014da 100644
--- a/packages/server/api/src/app/project/project-service.ts
+++ b/packages/server/api/src/app/project/project-service.ts
@@ -5,7 +5,6 @@ import { Brackets, EntityManager, IsNull, Not, ObjectLiteral, SelectQueryBuilder
import { system } from '../helper/system/system'
import { AppSystemProp } from '../helper/system/system-props'
import { userService } from '../user/user-service'
-import { projectWorkerGroupService } from '../workers/worker-groups/project-worker-group.service'
import { projectHooks, ProjectPostCreateContext } from './project-hooks'
import { projectRepo } from './project-repo'
diff --git a/packages/server/api/src/app/workers/job-queue/interceptors/rate-limiter-interceptor.ts b/packages/server/api/src/app/workers/job-queue/interceptors/rate-limiter-interceptor.ts
index 20a47e9200c..0213dd8d186 100644
--- a/packages/server/api/src/app/workers/job-queue/interceptors/rate-limiter-interceptor.ts
+++ b/packages/server/api/src/app/workers/job-queue/interceptors/rate-limiter-interceptor.ts
@@ -24,9 +24,13 @@ const FREE_CONCURRENT_JOBS_LIMIT = 5
const SELF_SERVE_CONCURRENT_JOBS_LIMIT = 15
const ENTERPRISE_CONCURRENT_JOBS_LIMIT = 30
-async function isPinnedToFlowGroup(jobData: ExecuteFlowJobData, log: FastifyBaseLogger): Promise<boolean> {
+async function resolveFlowGroupId(jobData: ExecuteFlowJobData, log: FastifyBaseLogger): Promise<string | null> {
+ const { data: workerGroupsEnabled } = await tryCatch(() => platformWorkerGroupService(log).isWorkerGroupsEnabled({ platformId: jobData.platformId }))
+ if (workerGroupsEnabled !== true) {
+ return null
+ }
const { data: flowGroupId } = await tryCatch(() => flowWorkerGroupService(log).getFlowWorkerGroup({ flowId: jobData.flowId }))
- return !isNil(flowGroupId)
+ return flowGroupId ?? null
}
function shouldContinue(jobData: JobData): jobData is ExecuteFlowJobData {
@@ -93,6 +97,10 @@ async function getMaxConcurrentJobs({ poolId, platformId, projectId, log }: { po
return planLimit
}
const slots = await resolveRoutedPoolSlots({ platformId, projectId, log })
+ return limitWithinSlots({ planLimit, slots })
+}
+
+function limitWithinSlots({ planLimit, slots }: { planLimit: number, slots: number }): number {
return slots > 0 ? Math.min(planLimit, slots) : planLimit
}
@@ -119,11 +127,18 @@ function decodeParkedMember(member: string): { queueName: string, jobId: string,
return { queueName, jobId, priority }
}
-async function tryAcquireSlot({ jobId, jobData, job, pinnedToFlowGroup, log }: { jobId: string, jobData: ExecuteFlowJobData, job: Job, pinnedToFlowGroup: boolean, log: FastifyBaseLogger }): Promise<boolean> {
- const flowTimeoutInMilliseconds = apDayjsDuration(system.getNumberOrThrow(AppSystemProp.FLOW_TIMEOUT_SECONDS), 'seconds').add(1, 'minute').asMilliseconds()
+async function resolveEffectivePoolId({ jobData, flowGroupId, log }: { jobData: ExecuteFlowJobData, flowGroupId: string | null, log: FastifyBaseLogger }): Promise<{ effectivePoolId: string, poolId: string | null }> {
+ if (!isNil(flowGroupId)) {
+ return { effectivePoolId: `flow-group:${flowGroupId}`, poolId: null }
+ }
const { data: poolId } = await tryCatch(() => concurrencyPoolService(log).getProjectPoolId(jobData.projectId))
- const effectivePoolId = poolId ?? jobData.projectId
- const maxConcurrentJobs = pinnedToFlowGroup
+ return { effectivePoolId: poolId ?? jobData.projectId, poolId }
+}
+
+async function tryAcquireSlot({ jobId, jobData, job, flowGroupId, log }: { jobId: string, jobData: ExecuteFlowJobData, job: Job, flowGroupId: string | null, log: FastifyBaseLogger }): Promise<boolean> {
+ const flowTimeoutInMilliseconds = apDayjsDuration(system.getNumberOrThrow(AppSystemProp.FLOW_TIMEOUT_SECONDS), 'seconds').add(1, 'minute').asMilliseconds()
+ const { effectivePoolId, poolId } = await resolveEffectivePoolId({ jobData, flowGroupId, log })
+ const maxConcurrentJobs = !isNil(flowGroupId)
? await getMaxConcurrentJobsForPlatformPlan({ platformId: jobData.platformId, log })
: await getMaxConcurrentJobs({
poolId,
@@ -187,9 +202,8 @@ return 0
return result === 0
}
-async function releaseSlot({ jobId, jobData, log }: { jobId: string, jobData: ExecuteFlowJobData, log: FastifyBaseLogger }): Promise<string> {
- const { data: poolId } = await tryCatch(() => concurrencyPoolService(log).getProjectPoolId(jobData.projectId))
- const effectivePoolId = poolId ?? jobData.projectId
+async function releaseSlot({ jobId, jobData, flowGroupId, log }: { jobId: string, jobData: ExecuteFlowJobData, flowGroupId: string | null, log: FastifyBaseLogger }): Promise<string> {
+ const { effectivePoolId } = await resolveEffectivePoolId({ jobData, flowGroupId, log })
const setKey = getConcurrencyPoolSetKey(effectivePoolId)
const member = `${jobData.projectId}:${jobId}`
const redisConnection = await redisConnections.useExisting()
@@ -243,8 +257,8 @@ export const rateLimiterInterceptor: JobInterceptor = {
return { verdict: InterceptorVerdict.ALLOW }
}
- const pinnedToFlowGroup = await isPinnedToFlowGroup(jobData, log)
- const allowed = await tryAcquireSlot({ jobId, jobData, job, pinnedToFlowGroup, log })
+ const flowGroupId = await resolveFlowGroupId(jobData, log)
+ const allowed = await tryAcquireSlot({ jobId, jobData, job, flowGroupId, log })
if (allowed) {
log.debug({ job: { id: jobId }, project: { id: jobData.projectId } }, '[rateLimiterInterceptor] Job allowed')
return { verdict: InterceptorVerdict.ALLOW }
@@ -263,7 +277,8 @@ export const rateLimiterInterceptor: JobInterceptor = {
if (!shouldContinue(jobData)) {
return
}
- const effectivePoolId = await releaseSlot({ jobId, jobData, log })
+ const flowGroupId = await resolveFlowGroupId(jobData, log)
+ const effectivePoolId = await releaseSlot({ jobId, jobData, flowGroupId, log })
log.debug({ job: { id: jobId }, project: { id: jobData.projectId } }, '[rateLimiterInterceptor] Slot released')
const { error } = await tryCatch(() => promoteNextParkedJob({ effectivePoolId, log }))
if (error) {
@@ -271,3 +286,16 @@ export const rateLimiterInterceptor: JobInterceptor = {
}
},
}
+
+export const projectConcurrencyDefaults = {
+ async resolver({ platformId, log }: { platformId: PlatformId, log: FastifyBaseLogger }): Promise<(projectWorkerGroupId: string | null) => number> {
+ const [planLimit, { projectGroups, shared }] = await Promise.all([
+ getMaxConcurrentJobsForPlatformPlan({ platformId, log }),
+ workerCapacity.get(),
+ ])
+ return (projectWorkerGroupId) => limitWithinSlots({
+ planLimit,
+ slots: isNil(projectWorkerGroupId) ? shared.slots : projectGroups.get(projectWorkerGroupId)?.slots ?? 0,
+ })
+ },
+}
diff --git a/packages/server/api/src/app/workers/machine/machine-service.ts b/packages/server/api/src/app/workers/machine/machine-service.ts
index 0c5f8c6496b..9aa429e2012 100644
--- a/packages/server/api/src/app/workers/machine/machine-service.ts
+++ b/packages/server/api/src/app/workers/machine/machine-service.ts
@@ -141,6 +141,15 @@ export const machineService = (log: FastifyBaseLogger) => {
sharedSlots,
}
},
+ async listOnlineWorkersByGroup(): Promise<OnlineWorkerSummary[]> {
+ const { online: onlineWorkers } = workerLiveness.partitionByLiveness(await workerMachineCache().find())
+ return onlineWorkers.map((worker) => ({
+ id: worker.id,
+ slots: parseWorkerConcurrency(worker.information.workerProps.WORKER_CONCURRENCY),
+ workerGroupId: isNil(worker.workerGroupId) || worker.workerGroupId.length === 0 ? null : worker.workerGroupId,
+ scope: resolveDedicatedScope(worker),
+ }))
+ },
async getWorkerGroupScopes({ workerGroupId }: { workerGroupId: string }): Promise<WorkerGroupScope[]> {
const { online: onlineWorkers } = workerLiveness.partitionByLiveness(await workerMachineCache().find())
const scopes = onlineWorkers
@@ -159,6 +168,13 @@ function resolveDedicatedScope(worker: { workerGroupId?: string, workerGroupScop
return worker.workerGroupScope ?? WorkerGroupScope.PROJECT
}
+type OnlineWorkerSummary = {
+ id: string
+ slots: number
+ workerGroupId: string | null
+ scope: WorkerGroupScope | null
+}
+
type WorkerGroupInfo = {
label: string
slots: number
diff --git a/packages/server/api/src/app/workers/worker-groups/flow-worker-group.service.ts b/packages/server/api/src/app/workers/worker-groups/flow-worker-group.service.ts
index c4bfe09d856..89f6f126b2c 100644
--- a/packages/server/api/src/app/workers/worker-groups/flow-worker-group.service.ts
+++ b/packages/server/api/src/app/workers/worker-groups/flow-worker-group.service.ts
@@ -1,16 +1,13 @@
-import { ActivepiecesError, ErrorCode, isNil, tryCatch } from '@activepieces/core-utils'
+import { isNil } from '@activepieces/core-utils'
import { apDayjsDuration } from '@activepieces/server-utils'
-import { FlowOperationStatus, WorkerGroupScope, WorkerJobType } from '@activepieces/shared'
+import { FlowOperationStatus } from '@activepieces/shared'
import { FastifyBaseLogger } from 'fastify'
import { distributedStore } from '../../database/redis-connections'
import { flowRepo } from '../../flows/flow/flow.repo'
import { flowVersionRepo } from '../../flows/flow-version/flow-version.service'
-import { machineService } from '../machine/machine-service'
-import { platformQueueMigrationService } from './queue-migration.service'
import { NO_WORKER_GROUP_SENTINEL, workerGroupQueues } from './worker-group-queues'
-import { workerGroupRouting } from './worker-group-routing'
-export const flowWorkerGroupService = (log: FastifyBaseLogger) => ({
+export const flowWorkerGroupService = (_log: FastifyBaseLogger) => ({
async getFlowWorkerGroup({ flowId }: { flowId: string }): Promise<string | null> {
const cached = await distributedStore.get<string>(getFlowWorkerGroupCacheKey(flowId))
if (!isNil(cached)) {
@@ -28,6 +25,13 @@ export const flowWorkerGroupService = (log: FastifyBaseLogger) => ({
return workerGroupId
},
+ async invalidateMany({ flowIds }: { flowIds: string[] }): Promise<void> {
+ if (flowIds.length === 0) {
+ return
+ }
+ await distributedStore.delete(flowIds.map(getFlowWorkerGroupCacheKey))
+ },
+
async invalidate({ flowId }: { flowId: string }): Promise<void> {
await distributedStore.delete(getFlowWorkerGroupCacheKey(flowId))
},
@@ -67,46 +71,6 @@ export const flowWorkerGroupService = (log: FastifyBaseLogger) => ({
}
},
- async assignFlowToGroup({ flowId, projectId, platformId, workerGroupId }: AssignFlowToGroupParams): Promise<void> {
- if (!isNil(workerGroupId) && !workerGroupQueues.isRoutableWorkerGroupId(workerGroupId)) {
- throw new ActivepiecesError({
- code: ErrorCode.VALIDATION,
- params: {
- message: `"${workerGroupId}" is not a valid worker group id`,
- },
- })
- }
- if (!isNil(workerGroupId)) {
- const groupScopes = await machineService(log).getWorkerGroupScopes({ workerGroupId })
- if (groupScopes.length > 0 && !groupScopes.includes(WorkerGroupScope.FLOW)) {
- throw new ActivepiecesError({
- code: ErrorCode.VALIDATION,
- params: {
- message: `"${workerGroupId}" has no flow-scope workers and cannot be assigned to a flow`,
- },
- })
- }
- }
- const flow = await flowRepo().findOneOrFail({
- select: ['id', 'workerGroupId'],
- where: { id: flowId, projectId },
- })
- const previousGroupId = flow.workerGroupId ?? null
- await flowRepo().update({ id: flowId, projectId }, { workerGroupId })
- await this.invalidate({ flowId })
- if (previousGroupId === workerGroupId) {
- return
- }
- const ungroupedQueueName = await workerGroupRouting.resolveQueueForJob({ platformId, projectId, jobType: WorkerJobType.EXECUTE_FLOW, log })
- const { error } = await tryCatch(() => platformQueueMigrationService(log).migrateFlowJobs({
- fromQueueName: isNil(previousGroupId) ? ungroupedQueueName : workerGroupQueues.getQueueName({ scope: WorkerGroupScope.FLOW, workerGroupId: previousGroupId }),
- toQueueName: isNil(workerGroupId) ? ungroupedQueueName : workerGroupQueues.getQueueName({ scope: WorkerGroupScope.FLOW, workerGroupId }),
- flowId,
- }))
- if (error) {
- log.error({ flow: { id: flowId }, project: { id: projectId }, error }, '[flowWorkerGroupService#assignFlowToGroup] Failed to migrate waiting jobs to the new worker group queue')
- }
- },
})
const getFlowWorkerGroupCacheKey = (flowId: string): string => `flow:${flowId}:worker_group`
@@ -114,12 +78,6 @@ const getFlowWorkerGroupCacheKey = (flowId: string): string => `flow:${flowId}:w
const CACHE_TTL_SECONDS = apDayjsDuration(5, 'minute').asSeconds()
const GROUP_FLOWS_LIMIT = 10
-type AssignFlowToGroupParams = {
- flowId: string
- projectId: string
- platformId: string
- workerGroupId: string | null
-}
type ListGroupFlowsParams = {
platformId: string
diff --git a/packages/server/api/src/app/workers/worker-groups/project-worker-group.service.ts b/packages/server/api/src/app/workers/worker-groups/project-worker-group.service.ts
index fd7d2420dcd..81e58d0f361 100644
--- a/packages/server/api/src/app/workers/worker-groups/project-worker-group.service.ts
+++ b/packages/server/api/src/app/workers/worker-groups/project-worker-group.service.ts
@@ -1,16 +1,11 @@
-import { ActivepiecesError, ErrorCode, isNil, spreadIfDefined, tryCatch } from '@activepieces/core-utils'
+import { isNil, spreadIfDefined } from '@activepieces/core-utils'
import { apDayjsDuration } from '@activepieces/server-utils'
-import { WorkerGroupScope } from '@activepieces/shared'
import { FastifyBaseLogger } from 'fastify'
import { distributedStore } from '../../database/redis-connections'
import { projectRepo } from '../../project/project-repo'
-import { QueueName } from '../job'
-import { machineService } from '../machine/machine-service'
-import { platformWorkerGroupService } from './platform-worker-group.service'
-import { platformQueueMigrationService } from './queue-migration.service'
import { NO_WORKER_GROUP_SENTINEL, workerGroupQueues } from './worker-group-queues'
-export const projectWorkerGroupService = (log: FastifyBaseLogger) => ({
+export const projectWorkerGroupService = (_log: FastifyBaseLogger) => ({
async getProjectWorkerGroup({ projectId, platformId }: { projectId: string, platformId?: string | null }): Promise<string | null> {
const cached = await distributedStore.get<string>(getProjectWorkerGroupCacheKey(projectId))
if (!isNil(cached)) {
@@ -35,72 +30,20 @@ export const projectWorkerGroupService = (log: FastifyBaseLogger) => ({
return projects.map((p) => p.id)
},
+ async invalidateMany({ projectIds }: { projectIds: string[] }): Promise<void> {
+ if (projectIds.length === 0) {
+ return
+ }
+ await distributedStore.delete(projectIds.map(getProjectWorkerGroupCacheKey))
+ },
+
async invalidate({ projectId }: { projectId: string }): Promise<void> {
await distributedStore.delete(getProjectWorkerGroupCacheKey(projectId))
},
- async assignProjectToGroup({ projectId, platformId, workerGroupId }: AssignProjectToGroupParams): Promise<void> {
- if (!isNil(workerGroupId) && !workerGroupQueues.isRoutableWorkerGroupId(workerGroupId)) {
- throw new ActivepiecesError({
- code: ErrorCode.VALIDATION,
- params: {
- message: `"${workerGroupId}" is not a valid worker group id`,
- },
- })
- }
- if (!isNil(workerGroupId)) {
- const groupScopes = await machineService(log).getWorkerGroupScopes({ workerGroupId })
- if (groupScopes.length > 0 && !groupScopes.includes(WorkerGroupScope.PROJECT)) {
- throw new ActivepiecesError({
- code: ErrorCode.VALIDATION,
- params: {
- message: `"${workerGroupId}" has no project-scope workers and cannot be assigned to a project`,
- },
- })
- }
- }
- const project = await projectRepo().findOne({
- select: ['id', 'workerGroupId'],
- where: { id: projectId, platformId },
- })
- if (isNil(project)) {
- throw new ActivepiecesError({
- code: ErrorCode.ENTITY_NOT_FOUND,
- params: {
- entityId: projectId,
- entityType: 'project',
- },
- })
- }
- const previousGroupId = project.workerGroupId ?? null
- await projectRepo().update({ id: projectId, platformId }, { workerGroupId })
- await this.invalidate({ projectId })
- if (previousGroupId === workerGroupId) {
- return
- }
- const ungroupedQueueName = await resolveUngroupedQueueName({ platformId, log })
- const { error } = await tryCatch(() => platformQueueMigrationService(log).migrateProjectJobs({
- fromQueueName: isNil(previousGroupId) ? ungroupedQueueName : workerGroupQueues.getQueueName({ scope: WorkerGroupScope.PROJECT, workerGroupId: previousGroupId }),
- toQueueName: isNil(workerGroupId) ? ungroupedQueueName : workerGroupQueues.getQueueName({ scope: WorkerGroupScope.PROJECT, workerGroupId }),
- projectId,
- }))
- if (error) {
- log.error({ project: { id: projectId }, platform: { id: platformId }, error }, '[projectWorkerGroupService#assignProjectToGroup] Failed to migrate waiting jobs to the new worker group queue')
- }
- },
})
-async function resolveUngroupedQueueName({ platformId, log }: { platformId: string, log: FastifyBaseLogger }): Promise<string> {
- const platformGroupId = await platformWorkerGroupService(log).getWorkerGroupId({ platformId })
- return isNil(platformGroupId) ? QueueName.WORKER_JOBS : workerGroupQueues.getQueueName({ scope: WorkerGroupScope.PLATFORM, workerGroupId: platformGroupId })
-}
-
const getProjectWorkerGroupCacheKey = (projectId: string): string => `project:${projectId}:worker_group`
const CACHE_TTL_SECONDS = apDayjsDuration(5, 'minute').asSeconds()
-type AssignProjectToGroupParams = {
- projectId: string
- platformId: string
- workerGroupId: string | null
-}
diff --git a/packages/server/api/src/app/workers/worker-groups/queue-migration.service.ts b/packages/server/api/src/app/workers/worker-groups/queue-migration.service.ts
index dc875ba95c1..a084e087c64 100644
--- a/packages/server/api/src/app/workers/worker-groups/queue-migration.service.ts
+++ b/packages/server/api/src/app/workers/worker-groups/queue-migration.service.ts
@@ -33,9 +33,23 @@ export const platformQueueMigrationService = (log: FastifyBaseLogger) => ({
await migrateRegularJobs({ sourceQueue, targetQueue, batchSize, belongsTo: job => job.data?.flowId === flowId && PROJECT_GROUP_ROUTABLE_JOB_TYPES.has(job.data?.jobType) })
},
+ async migrateAssignmentJobs({ fromQueueName, toQueueName, projectIds, flowIds, batchSize = 200 }: MigrateAssignmentJobsParams): Promise<string[]> {
+ if (fromQueueName === toQueueName || (projectIds.size === 0 && flowIds.size === 0)) {
+ return []
+ }
+ const sourceQueue = await jobQueue(log).getOrCreateQueue({ queueName: fromQueueName })
+ const targetQueue = await jobQueue(log).getOrCreateQueue({ queueName: toQueueName })
+ return migrateRegularJobs({
+ sourceQueue,
+ targetQueue,
+ batchSize,
+ belongsTo: job => PROJECT_GROUP_ROUTABLE_JOB_TYPES.has(job.data?.jobType) && (projectIds.has(job.data?.projectId) || flowIds.has(job.data?.flowId)),
+ })
+ },
})
-async function migrateRegularJobs({ sourceQueue, targetQueue, belongsTo, batchSize }: MigrateRegularJobsParams): Promise<void> {
+async function migrateRegularJobs({ sourceQueue, targetQueue, belongsTo, batchSize }: MigrateRegularJobsParams): Promise<string[]> {
+ const movedJobIds: string[] = []
for (const state of ['waiting', 'prioritized', 'delayed', 'paused'] as const) {
let offset = 0
while (true) {
@@ -46,6 +60,7 @@ async function migrateRegularJobs({ sourceQueue, targetQueue, belongsTo, batchSi
const matchedJobs = jobs.filter(job => belongsTo(job) && !job.repeatJobKey)
const skipped = jobs.length - matchedJobs.length
+ movedJobIds.push(...matchedJobs.flatMap(job => isNil(job.id) ? [] : [job.id]))
await Promise.all(matchedJobs.map(async (job) => {
if (isNil(job.id)) {
@@ -71,6 +86,7 @@ async function migrateRegularJobs({ sourceQueue, targetQueue, belongsTo, batchSi
}
}
}
+ return movedJobIds
}
async function migrateSchedulers({ sourceQueue, targetQueue, platformId, batchSize, log }: MigrateQueueParams & { log: FastifyBaseLogger }): Promise<void> {
@@ -194,6 +210,14 @@ type MigrateFlowJobsParams = {
batchSize?: number
}
+type MigrateAssignmentJobsParams = {
+ fromQueueName: string
+ toQueueName: string
+ projectIds: Set<string>
+ flowIds: Set<string>
+ batchSize?: number
+}
+
type MigrateRegularJobsParams = {
sourceQueue: Queue
targetQueue: Queue
diff --git a/packages/server/api/src/app/workers/worker-groups/worker-group-assignment.service.ts b/packages/server/api/src/app/workers/worker-groups/worker-group-assignment.service.ts
new file mode 100644
index 00000000000..9bfa78ce199
--- /dev/null
+++ b/packages/server/api/src/app/workers/worker-groups/worker-group-assignment.service.ts
@@ -0,0 +1,667 @@
+import { ActivepiecesError, chunk, ErrorCode, isNil, tryCatch } from '@activepieces/core-utils'
+import {
+ FlowOperationStatus,
+ FlowStatus,
+ ListWorkerGroupFlowsRequest,
+ ListWorkerGroupProjectsRequest,
+ WorkerGroupFlowAssignment,
+ WorkerGroupFlowAssignmentPage,
+ WorkerGroupMoveResult,
+ WorkerGroupProjectAssignment,
+ WorkerGroupProjectAssignmentPage,
+ WorkerGroupScope,
+ WorkerGroupsOverview,
+ WorkerGroupSummary,
+} from '@activepieces/shared'
+import { FastifyBaseLogger } from 'fastify'
+import { In, IsNull, ObjectLiteral, SelectQueryBuilder } from 'typeorm'
+import { transaction } from '../../core/db/transaction'
+import { databaseConnection } from '../../database/database-connection'
+import { distributedLock } from '../../database/redis-connections'
+import { flowRepo } from '../../flows/flow/flow.repo'
+import { flowVersionRepo } from '../../flows/flow-version/flow-version.service'
+import { projectRepo } from '../../project/project-repo'
+import { QueueName } from '../job'
+import { projectConcurrencyDefaults } from '../job-queue/interceptors/rate-limiter-interceptor'
+import { jobQueue } from '../job-queue/job-queue'
+import { machineService } from '../machine/machine-service'
+import { flowWorkerGroupService } from './flow-worker-group.service'
+import { platformWorkerGroupService } from './platform-worker-group.service'
+import { projectWorkerGroupService } from './project-worker-group.service'
+import { platformQueueMigrationService } from './queue-migration.service'
+import { workerGroupQueues } from './worker-group-queues'
+
+export const workerGroupAssignmentService = (log: FastifyBaseLogger) => ({
+ async overview({ platformId }: { platformId: string }): Promise<WorkerGroupsOverview> {
+ const [projectCounts, flowCounts, workers, platformGroupId, projectSamples, flowSamples] = await Promise.all([
+ projectRepo()
+ .createQueryBuilder('project')
+ .select('project."workerGroupId"', 'label')
+ .addSelect('COUNT(*)::int', 'count')
+ .where('project."platformId" = :platformId', { platformId })
+ .andWhere('project.deleted IS NULL')
+ .groupBy('project."workerGroupId"')
+ .getRawMany<{ label: string | null, count: number }>(),
+ platformFlows({ platformId })
+ .select('project."workerGroupId"', 'projectGroup')
+ .addSelect('flow."workerGroupId"', 'pinned')
+ .addSelect('COUNT(*)::int', 'count')
+ .groupBy('project."workerGroupId"')
+ .addGroupBy('flow."workerGroupId"')
+ .getRawMany<{ projectGroup: string | null, pinned: string | null, count: number }>(),
+ machineService(log).listOnlineWorkersByGroup(),
+ platformWorkerGroupService(log).getWorkerGroupId({ platformId }),
+ firstNamesPerGroup(platformProjects({ platformId })
+ .select('project."workerGroupId"', 'label')
+ .addSelect('project."displayName"', 'name')
+ .addSelect('ROW_NUMBER() OVER (PARTITION BY project."workerGroupId")', 'position')),
+ firstNamesPerGroup(withLatestVersion(platformFlows({ platformId }))
+ .andWhere('flow."workerGroupId" IS NOT NULL')
+ .select('flow."workerGroupId"', 'label')
+ .addSelect('latest_version."displayName"', 'name')
+ .addSelect('ROW_NUMBER() OVER (PARTITION BY flow."workerGroupId")', 'position')),
+ ])
+
+ const projectsByLabel = new Map(projectCounts.map((row) => [row.label, row.count]))
+ const inheritedFlows = countByLabel(flowCounts.filter((row) => isNil(row.pinned)).map((row) => ({ label: row.projectGroup, count: row.count })))
+ const pinnedFlows = countByLabel(flowCounts.filter((row) => !isNil(row.pinned)).map((row) => ({ label: row.pinned, count: row.count })))
+
+ const scopeSources: ScopeSource[] = [
+ {
+ scope: WorkerGroupScope.PROJECT,
+ assignedLabels: [...projectsByLabel.keys()],
+ projectCount: (label) => projectsByLabel.get(label) ?? 0,
+ flowCount: (label) => inheritedFlows.get(label) ?? 0,
+ samples: projectSamples,
+ },
+ {
+ scope: WorkerGroupScope.FLOW,
+ assignedLabels: [...pinnedFlows.keys()],
+ projectCount: () => 0,
+ flowCount: (label) => pinnedFlows.get(label) ?? 0,
+ samples: flowSamples,
+ },
+ ]
+
+ const groups: WorkerGroupSummary[] = (await Promise.all(scopeSources.flatMap((source) => {
+ const scopeWorkers = workers.flatMap((w) => w.scope === source.scope && !isNil(w.workerGroupId) && isListedLabel(w.workerGroupId)
+ ? [{ slots: w.slots, workerGroupId: w.workerGroupId }]
+ : [])
+ const onlineLabels = [...new Set(scopeWorkers.map((w) => w.workerGroupId))]
+ const labels = [...new Set([...onlineLabels, ...source.assignedLabels])]
+ .filter((label): label is string => !isNil(label) && isListedLabel(label))
+ return labels.map(async (label): Promise<WorkerGroupSummary> => {
+ const machines = scopeWorkers.filter((w) => w.workerGroupId === label)
+ return {
+ label,
+ scope: source.scope,
+ online: machines.length,
+ slots: sumSlots(machines),
+ waiting: machines.length === 0 ? await countWaitingJobs({ queueName: workerGroupQueues.getQueueName({ scope: source.scope, workerGroupId: label }), platformId, log }) : 0,
+ projectCount: source.projectCount(label),
+ flowCount: source.flowCount(label),
+ sample: source.samples.get(label) ?? [],
+ }
+ })
+ }))).sort(compareGroups)
+
+ const defaultWorkers = workers.filter((w) => isNil(platformGroupId)
+ ? isNil(w.workerGroupId)
+ : w.scope === WorkerGroupScope.PLATFORM && w.workerGroupId === platformGroupId)
+ return {
+ defaultGroup: {
+ online: defaultWorkers.length,
+ slots: sumSlots(defaultWorkers),
+ projectCount: projectsByLabel.get(null) ?? 0,
+ flowCount: inheritedFlows.get(null) ?? 0,
+ sample: projectSamples.get(null) ?? [],
+ },
+ groups,
+ }
+ },
+
+ async listProjects({ platformId, request }: { platformId: string, request: ListWorkerGroupProjectsRequest }): Promise<WorkerGroupProjectAssignmentPage> {
+ const query = platformProjects({ platformId })
+ if (request.filter === 'shared') {
+ query.andWhere('project."workerGroupId" IS NULL')
+ }
+ else if (!isNil(request.group) && request.filter !== 'all') {
+ query.andWhere('project."workerGroupId" = :group', { group: request.group })
+ }
+ if (!isNil(request.search) && request.search.length > 0) {
+ query.andWhere('LOWER(project."displayName") LIKE LOWER(:search)', { search: likePattern(request.search) })
+ }
+ if (!isNil(request.exclude)) {
+ query.andWhere('project."workerGroupId" IS DISTINCT FROM :exclude', { exclude: request.exclude })
+ }
+ const total = await query.getCount()
+ const offset = clampOffset({ offset: request.cursor ?? 0, total, limit: request.limit })
+ const rows = await applyOrder(query.select(PROJECT_SELECT), PROJECT_ORDER)
+ .offset(offset)
+ .limit(request.limit)
+ .getRawMany<ProjectRow>()
+ return toPage({ data: await withFlowStats({ rows, platformId, log }), offset, limit: request.limit, total })
+ },
+
+ async listFlows({ platformId, request }: { platformId: string, request: ListWorkerGroupFlowsRequest }): Promise<WorkerGroupFlowAssignmentPage> {
+ const base = platformFlows({ platformId })
+ if (!isNil(request.projectId)) {
+ base.andWhere('flow."projectId" = :projectId', { projectId: request.projectId })
+ }
+ if (request.filter === 'pinned') {
+ base.andWhere('flow."workerGroupId" IS NOT NULL')
+ }
+ else if (!isNil(request.group) && request.filter !== 'all') {
+ base.andWhere('flow."workerGroupId" = :group', { group: request.group })
+ }
+ if (!isNil(request.exclude)) {
+ base.andWhere('flow."workerGroupId" IS DISTINCT FROM :exclude', { exclude: request.exclude })
+ }
+ const search = request.search
+ const hasSearch = !isNil(search) && search.length > 0
+ const query = withLatestVersion(base.clone())
+ if (hasSearch) {
+ query.andWhere('LOWER(latest_version."displayName") LIKE LOWER(:search)', { search: likePattern(search) })
+ }
+ const order: SortKey[] = isNil(request.projectId) ? FLOW_ORDER : [['flow."workerGroupId" IS NULL', 'ASC'], ...FLOW_ORDER]
+ const total = await (hasSearch ? query : base).getCount()
+ const offset = clampOffset({ offset: request.cursor ?? 0, total, limit: request.limit })
+ const rows = await applyOrder(query.select(FLOW_SELECT), order)
+ .offset(offset)
+ .limit(request.limit)
+ .getRawMany<FlowRow>()
+ return toPage({ data: rows.map(toFlowAssignment), offset, limit: request.limit, total })
+ },
+
+ async assignProjects({ platformId, projectIds, workerGroupId }: AssignProjectsParams): Promise<WorkerGroupMoveResult> {
+ return withAssignLock({
+ platformId,
+ log,
+ fn: () => applyProjectAssignment({ platformId, projectIds, workerGroupId, log }),
+ })
+ },
+
+ async assignFlows({ platformId, flowIds, workerGroupId }: AssignFlowsParams): Promise<WorkerGroupMoveResult> {
+ return withAssignLock({
+ platformId,
+ log,
+ fn: () => applyFlowAssignment({ platformId, flowIds, workerGroupId, log }),
+ })
+ },
+
+ async moveAll({ platformId, from, to, scope }: MoveAllParams): Promise<WorkerGroupMoveResult> {
+ if (from === to) {
+ return { movedWaitingRuns: 0, projects: [], flows: [] }
+ }
+ return withAssignLock({
+ platformId,
+ log,
+ fn: async () => {
+ if (scope === WorkerGroupScope.PROJECT) {
+ const projectIds = (await projectRepo().find({ select: ['id'], where: { platformId, workerGroupId: from, deleted: IsNull() } })).map((p) => p.id)
+ if (projectIds.length === 0) {
+ return { movedWaitingRuns: 0, projects: [], flows: [] }
+ }
+ return applyProjectAssignment({ platformId, projectIds, workerGroupId: to, log })
+ }
+ const flowIds = (await platformFlows({ platformId })
+ .andWhere('flow."workerGroupId" = :from', { from })
+ .select('flow.id', 'id')
+ .getRawMany<{ id: string }>()).map((f) => f.id)
+ if (flowIds.length === 0) {
+ return { movedWaitingRuns: 0, projects: [], flows: [] }
+ }
+ return applyFlowAssignment({ platformId, flowIds, workerGroupId: to, log })
+ },
+ })
+ },
+})
+
+async function withAssignLock<T>({ platformId, log, fn }: { platformId: string, log: FastifyBaseLogger, fn: () => Promise<T> }): Promise<T> {
+ return distributedLock(log).runExclusive({
+ key: `worker-group-assign:${platformId}`,
+ timeoutInSeconds: ASSIGN_LOCK_TIMEOUT_SECONDS,
+ fn,
+ })
+}
+
+async function applyProjectAssignment({ platformId, projectIds, workerGroupId, log }: AssignProjectsParams & { log: FastifyBaseLogger }): Promise<WorkerGroupMoveResult> {
+ await assertProjectsAssignable({ workerGroupId, log })
+ const uniqueProjectIds = [...new Set(projectIds)]
+ const projects = (await Promise.all(chunk(uniqueProjectIds, MAX_IDS_PER_QUERY).map((ids) => projectRepo().find({
+ select: ['id', 'workerGroupId'],
+ where: { id: In(ids), platformId, deleted: IsNull() },
+ })))).flat()
+ if (projects.length !== uniqueProjectIds.length) {
+ throw new ActivepiecesError({
+ code: ErrorCode.ENTITY_NOT_FOUND,
+ params: { message: 'Some projects were not found on this platform' },
+ })
+ }
+
+ await transaction(async (manager) => {
+ for (const ids of chunk(projects.map((p) => p.id), MAX_IDS_PER_QUERY)) {
+ await projectRepo(manager).update({ id: In(ids), platformId }, { workerGroupId })
+ }
+ })
+ await projectWorkerGroupService(log).invalidateMany({ projectIds: projects.map((p) => p.id) })
+
+ const movedWaitingRuns = await migrateProjectQueuedJobs({
+ platformId,
+ projects: projects.map((p) => ({ id: p.id, from: p.workerGroupId ?? null })),
+ to: workerGroupId,
+ log,
+ })
+ return {
+ movedWaitingRuns,
+ projects: projects.map((p) => p.id),
+ flows: [],
+ }
+}
+
+async function applyFlowAssignment({ platformId, flowIds, workerGroupId, log }: AssignFlowsParams & { log: FastifyBaseLogger }): Promise<WorkerGroupMoveResult> {
+ await assertFlowsAssignable({ workerGroupId, log })
+ const uniqueFlowIds = [...new Set(flowIds)]
+ const flows = (await Promise.all(chunk(uniqueFlowIds, MAX_IDS_PER_QUERY).map((ids) => platformFlows({ platformId })
+ .andWhere('flow.id IN (:...flowIds)', { flowIds: ids })
+ .select('flow.id', 'id')
+ .addSelect('flow."projectId"', 'projectId')
+ .addSelect('flow."workerGroupId"', 'workerGroupId')
+ .getRawMany<{ id: string, projectId: string, workerGroupId: string | null }>()))).flat()
+ if (flows.length !== uniqueFlowIds.length) {
+ throw new ActivepiecesError({
+ code: ErrorCode.ENTITY_NOT_FOUND,
+ params: { message: 'Some flows were not found on this platform' },
+ })
+ }
+
+ await transaction(async (manager) => {
+ for (const ids of chunk(flows.map((f) => f.id), MAX_IDS_PER_QUERY)) {
+ await flowRepo(manager).update({ id: In(ids) }, { workerGroupId })
+ }
+ })
+ await flowWorkerGroupService(log).invalidateMany({ flowIds: flows.map((f) => f.id) })
+
+ const movedWaitingRuns = await migrateFlowQueuedJobs({
+ platformId,
+ flows: flows.map((f) => ({ id: f.id, projectId: f.projectId, from: f.workerGroupId })),
+ to: workerGroupId,
+ log,
+ })
+ return {
+ movedWaitingRuns,
+ projects: [],
+ flows: flows.map((f) => f.id),
+ }
+}
+
+async function assertProjectsAssignable({ workerGroupId, log }: AssertAssignableParams): Promise<void> {
+ if (isNil(workerGroupId)) {
+ return
+ }
+ if (!workerGroupQueues.isRoutableWorkerGroupId(workerGroupId)) {
+ throw new ActivepiecesError({
+ code: ErrorCode.VALIDATION,
+ params: { message: `"${workerGroupId}" is not a valid worker group id` },
+ })
+ }
+ const scopes = await machineService(log).getWorkerGroupScopes({ workerGroupId })
+ if (scopes.length > 0 && !scopes.includes(WorkerGroupScope.PROJECT)) {
+ throw new ActivepiecesError({
+ code: ErrorCode.VALIDATION,
+ params: { message: `"${workerGroupId}" does not accept projects` },
+ })
+ }
+}
+
+async function assertFlowsAssignable({ workerGroupId, log }: AssertAssignableParams): Promise<void> {
+ if (isNil(workerGroupId)) {
+ return
+ }
+ if (!workerGroupQueues.isRoutableWorkerGroupId(workerGroupId)) {
+ throw new ActivepiecesError({
+ code: ErrorCode.VALIDATION,
+ params: { message: `"${workerGroupId}" is not a valid worker group id` },
+ })
+ }
+ const scopes = await machineService(log).getWorkerGroupScopes({ workerGroupId })
+ if (scopes.length > 0 && !scopes.includes(WorkerGroupScope.FLOW)) {
+ throw new ActivepiecesError({
+ code: ErrorCode.VALIDATION,
+ params: { message: `"${workerGroupId}" does not accept flows` },
+ })
+ }
+}
+
+async function migrateProjectQueuedJobs({ platformId, projects, to, log }: MigrateProjectQueuedJobsParams): Promise<number> {
+ const platformGroupId = await platformWorkerGroupService(log).getWorkerGroupId({ platformId })
+ const ungroupedQueue = isNil(platformGroupId)
+ ? QueueName.WORKER_JOBS
+ : workerGroupQueues.getQueueName({ scope: WorkerGroupScope.PLATFORM, workerGroupId: platformGroupId })
+ const projectQueue = (label: string | null): string => isNil(label) || !workerGroupQueues.isRoutableWorkerGroupId(label)
+ ? ungroupedQueue
+ : workerGroupQueues.getQueueName({ scope: WorkerGroupScope.PROJECT, workerGroupId: label })
+
+ const moves = new Map<string, { from: string, to: string, projectIds: Set<string> }>()
+ for (const project of projects) {
+ const from = projectQueue(project.from)
+ const target = projectQueue(to)
+ if (from === target) {
+ continue
+ }
+ const key = `${from}→${target}`
+ const move = moves.get(key) ?? { from, to: target, projectIds: new Set<string>() }
+ move.projectIds.add(project.id)
+ moves.set(key, move)
+ }
+
+ const movedJobIds = new Set<string>()
+ for (const move of moves.values()) {
+ const { data, error } = await tryCatch(() => platformQueueMigrationService(log).migrateAssignmentJobs({
+ fromQueueName: move.from,
+ toQueueName: move.to,
+ projectIds: move.projectIds,
+ flowIds: new Set<string>(),
+ }))
+ if (error) {
+ log.error({ platform: { id: platformId }, from: move.from, to: move.to, error }, '[workerGroupAssignmentService#assignProjects] Failed to move waiting jobs to the new worker group queue')
+ continue
+ }
+ data.forEach((jobId) => movedJobIds.add(jobId))
+ }
+ return movedJobIds.size
+}
+
+async function migrateFlowQueuedJobs({ platformId, flows, to, log }: MigrateFlowQueuedJobsParams): Promise<number> {
+ const platformGroupId = await platformWorkerGroupService(log).getWorkerGroupId({ platformId })
+ const ungroupedQueue = isNil(platformGroupId)
+ ? QueueName.WORKER_JOBS
+ : workerGroupQueues.getQueueName({ scope: WorkerGroupScope.PLATFORM, workerGroupId: platformGroupId })
+
+ const flowProjectIds = [...new Set(flows.map((f) => f.projectId))]
+ const flowProjects = (await Promise.all(chunk(flowProjectIds, MAX_IDS_PER_QUERY).map((ids) => projectRepo().find({
+ select: ['id', 'workerGroupId'],
+ where: { id: In(ids), platformId },
+ })))).flat()
+ const projectGroupById = new Map(flowProjects.map((p) => [p.id, p.workerGroupId ?? null]))
+ const flowQueue = (label: string | null, projectId: string): string => {
+ if (!isNil(label)) {
+ return workerGroupQueues.getQueueName({ scope: WorkerGroupScope.FLOW, workerGroupId: label })
+ }
+ const projectGroup = projectGroupById.get(projectId) ?? null
+ return isNil(projectGroup) || !workerGroupQueues.isRoutableWorkerGroupId(projectGroup)
+ ? ungroupedQueue
+ : workerGroupQueues.getQueueName({ scope: WorkerGroupScope.PROJECT, workerGroupId: projectGroup })
+ }
+
+ const moves = new Map<string, { from: string, to: string, flowIds: Set<string> }>()
+ for (const flow of flows) {
+ const from = flowQueue(flow.from, flow.projectId)
+ const target = flowQueue(to, flow.projectId)
+ if (from === target) {
+ continue
+ }
+ const key = `${from}→${target}`
+ const move = moves.get(key) ?? { from, to: target, flowIds: new Set<string>() }
+ move.flowIds.add(flow.id)
+ moves.set(key, move)
+ }
+
+ const movedJobIds = new Set<string>()
+ for (const move of moves.values()) {
+ const { data, error } = await tryCatch(() => platformQueueMigrationService(log).migrateAssignmentJobs({
+ fromQueueName: move.from,
+ toQueueName: move.to,
+ projectIds: new Set<string>(),
+ flowIds: move.flowIds,
+ }))
+ if (error) {
+ log.error({ platform: { id: platformId }, from: move.from, to: move.to, error }, '[workerGroupAssignmentService#assignFlows] Failed to move waiting jobs to the new worker group queue')
+ continue
+ }
+ data.forEach((jobId) => movedJobIds.add(jobId))
+ }
+ return movedJobIds.size
+}
+
+async function countWaitingJobs({ queueName, platformId, log }: { queueName: string, platformId: string, log: FastifyBaseLogger }): Promise<number> {
+ const queue = await jobQueue(log).getOrCreateQueue({ queueName })
+ const byState = await queue.getJobCounts(...WAITING_STATES)
+ if (Object.values(byState).every((value) => value === 0)) {
+ return 0
+ }
+ let count = 0
+ for (const state of WAITING_STATES) {
+ let offset = 0
+ while (true) {
+ const jobs = await queue.getJobs([state], offset, offset + WAITING_SCAN_BATCH_SIZE - 1)
+ count += jobs.filter((job) => job.data?.platformId === platformId).length
+ if (jobs.length < WAITING_SCAN_BATCH_SIZE) {
+ break
+ }
+ offset += WAITING_SCAN_BATCH_SIZE
+ }
+ }
+ return count
+}
+
+function countByLabel(rows: { label: string | null, count: number }[]): Map<string | null, number> {
+ return rows.reduce((byLabel, row) => byLabel.set(row.label, (byLabel.get(row.label) ?? 0) + row.count), new Map<string | null, number>())
+}
+
+function compareGroups(a: WorkerGroupSummary, b: WorkerGroupSummary): number {
+ if (a.label !== b.label) {
+ return a.label < b.label ? -1 : 1
+ }
+ return a.scope.localeCompare(b.scope)
+}
+
+function isListedLabel(label: string): boolean {
+ return workerGroupQueues.isRoutableWorkerGroupId(label)
+}
+
+function clampOffset({ offset, total, limit }: { offset: number, total: number, limit: number }): number {
+ return Math.min(offset, Math.floor(Math.max(total - 1, 0) / limit) * limit)
+}
+
+function platformProjects({ platformId }: { platformId: string }) {
+ return projectRepo()
+ .createQueryBuilder('project')
+ .where('project."platformId" = :platformId', { platformId })
+ .andWhere('project.deleted IS NULL')
+}
+
+function platformFlows({ platformId }: { platformId: string }) {
+ return flowRepo()
+ .createQueryBuilder('flow')
+ .innerJoin('project', 'project', 'project.id = flow."projectId"')
+ .where('project."platformId" = :platformId', { platformId })
+ .andWhere('project.deleted IS NULL')
+ .andWhere('flow."operationStatus" != :deleting', { deleting: FlowOperationStatus.DELETING })
+}
+
+function applyOrder<T extends ObjectLiteral>(query: SelectQueryBuilder<T>, order: SortKey[]): SelectQueryBuilder<T> {
+ const [[firstExpression, firstDirection], ...rest] = order
+ return rest.reduce(
+ (sorted, [expression, direction]) => sorted.addOrderBy(expression, direction),
+ query.orderBy(firstExpression, firstDirection),
+ )
+}
+
+function withLatestVersion<T extends ObjectLiteral>(query: SelectQueryBuilder<T>): SelectQueryBuilder<T> {
+ const latestVersion = flowVersionRepo()
+ .createQueryBuilder('fv_sub')
+ .select('fv_sub.id')
+ .where('fv_sub."flowId" = flow.id')
+ .orderBy('fv_sub.created', 'DESC')
+ .limit(1)
+ return query.leftJoin(
+ 'flow_version',
+ 'latest_version',
+ `latest_version."flowId" = flow.id AND latest_version.id = (${latestVersion.getQuery()})`,
+ )
+}
+
+async function firstNamesPerGroup<T extends ObjectLiteral>(ranked: SelectQueryBuilder<T>): Promise<Map<string | null, string[]>> {
+ const rows = await databaseConnection()
+ .createQueryBuilder()
+ .select('ranked.label', 'label')
+ .addSelect('ranked.name', 'name')
+ .from(`(${ranked.getQuery()})`, 'ranked')
+ .where('ranked.position <= :max', { max: GROUP_SAMPLE_SIZE })
+ .setParameters(ranked.getParameters())
+ .orderBy('ranked.position', 'ASC')
+ .getRawMany<{ label: string | null, name: string | null }>()
+ return rows.reduce((byLabel, row) => byLabel.set(row.label, [...(byLabel.get(row.label) ?? []), row.name ?? '']), new Map<string | null, string[]>())
+}
+
+function sumSlots(workers: { slots: number }[]): number {
+ return workers.reduce((sum, worker) => sum + worker.slots, 0)
+}
+
+async function withFlowStats({ rows, platformId, log }: { rows: ProjectRow[], platformId: string, log: FastifyBaseLogger }): Promise<WorkerGroupProjectAssignment[]> {
+ if (rows.length === 0) {
+ return []
+ }
+ const defaultLimit = await projectConcurrencyDefaults.resolver({ platformId, log })
+ const stats = await flowRepo()
+ .createQueryBuilder('flow')
+ .select('flow."projectId"', 'projectId')
+ .addSelect('flow."workerGroupId"', 'workerGroupId')
+ .addSelect('COUNT(*)::int', 'count')
+ .where('flow."projectId" IN (:...projectIds)', { projectIds: rows.map((r) => r.id) })
+ .andWhere('flow."operationStatus" != :deleting', { deleting: FlowOperationStatus.DELETING })
+ .groupBy('flow."projectId"')
+ .addGroupBy('flow."workerGroupId"')
+ .getRawMany<{ projectId: string, workerGroupId: string | null, count: number }>()
+ return rows.map((row) => {
+ const own = stats.filter((s) => s.projectId === row.id)
+ const pinned = own.filter((s): s is { projectId: string, workerGroupId: string, count: number } => !isNil(s.workerGroupId))
+ return {
+ id: row.id,
+ displayName: row.displayName,
+ color: row.icon?.color ?? '',
+ workerGroupId: row.workerGroupId,
+ maxConcurrentJobs: row.maxConcurrentJobs,
+ defaultMaxConcurrentJobs: defaultLimit(row.workerGroupId),
+ flowCount: own.reduce((sum, s) => sum + s.count, 0),
+ flowsElsewhere: pinned.reduce((sum, s) => sum + s.count, 0),
+ pinnedFlows: pinned.map((s) => ({ workerGroupId: s.workerGroupId, count: s.count })),
+ }
+ })
+}
+
+function toFlowAssignment(row: FlowRow): WorkerGroupFlowAssignment {
+ return {
+ id: row.id,
+ displayName: row.displayName ?? row.id,
+ projectId: row.projectId,
+ projectName: row.projectName,
+ projectColor: row.projectIcon?.color ?? '',
+ enabled: row.status === FlowStatus.ENABLED,
+ workerGroupId: row.workerGroupId,
+ inherited: row.projectWorkerGroupId,
+ effective: row.workerGroupId ?? row.projectWorkerGroupId,
+ }
+}
+
+function toPage<T>({ data, offset, limit, total }: { data: T[], offset: number, limit: number, total: number }): { data: T[], next: string | null, previous: string | null, offset: number, total: number } {
+ return {
+ data,
+ next: offset + limit < total ? String(offset + limit) : null,
+ previous: offset > 0 ? String(Math.max(0, offset - limit)) : null,
+ offset,
+ total,
+ }
+}
+
+function likePattern(value: string): string {
+ return `%${value.replace(/[\\%_]/g, (match) => `\\${match}`)}%`
+}
+
+const PROJECT_ORDER: SortKey[] = [['project.id', 'ASC']]
+const FLOW_ORDER: SortKey[] = [['flow.id', 'ASC']]
+const PROJECT_SELECT = ['project.id AS id', 'project."displayName" AS "displayName"', 'project.icon AS icon', 'project."workerGroupId" AS "workerGroupId"', 'project."maxConcurrentJobs" AS "maxConcurrentJobs"']
+const FLOW_SELECT = [
+ 'flow.id AS id',
+ 'flow."projectId" AS "projectId"',
+ 'flow.status AS status',
+ 'flow."workerGroupId" AS "workerGroupId"',
+ 'latest_version."displayName" AS "displayName"',
+ 'project."displayName" AS "projectName"',
+ 'project.icon AS "projectIcon"',
+ 'project."workerGroupId" AS "projectWorkerGroupId"',
+]
+const GROUP_SAMPLE_SIZE = 4
+const MAX_IDS_PER_QUERY = 1000
+const ASSIGN_LOCK_TIMEOUT_SECONDS = 120
+const WAITING_SCAN_BATCH_SIZE = 500
+const WAITING_STATES = ['waiting', 'prioritized', 'delayed', 'paused'] as const
+
+type ProjectRow = {
+ id: string
+ displayName: string
+ icon: { color?: string } | null
+ workerGroupId: string | null
+ maxConcurrentJobs: number | null
+}
+
+type FlowRow = {
+ id: string
+ projectId: string
+ status: FlowStatus
+ workerGroupId: string | null
+ displayName: string | null
+ projectName: string
+ projectIcon: { color?: string } | null
+ projectWorkerGroupId: string | null
+}
+
+type AssignProjectsParams = {
+ platformId: string
+ projectIds: string[]
+ workerGroupId: string | null
+}
+
+type AssignFlowsParams = {
+ platformId: string
+ flowIds: string[]
+ workerGroupId: string | null
+}
+
+type MoveAllParams = {
+ platformId: string
+ from: string
+ to: string | null
+ scope: WorkerGroupScope.PROJECT | WorkerGroupScope.FLOW
+}
+
+type ScopeSource = {
+ scope: WorkerGroupScope.PROJECT | WorkerGroupScope.FLOW
+ assignedLabels: (string | null)[]
+ projectCount: (label: string) => number
+ flowCount: (label: string) => number
+ samples: Map<string | null, string[]>
+}
+
+type AssertAssignableParams = {
+ workerGroupId: string | null
+ log: FastifyBaseLogger
+}
+
+type MigrateProjectQueuedJobsParams = {
+ platformId: string
+ projects: { id: string, from: string | null }[]
+ to: string | null
+ log: FastifyBaseLogger
+}
+
+type MigrateFlowQueuedJobsParams = {
+ platformId: string
+ flows: { id: string, projectId: string, from: string | null }[]
+ to: string | null
+ log: FastifyBaseLogger
+}
+
+type SortKey = [string, 'ASC' | 'DESC']
+
diff --git a/packages/server/api/src/app/workers/worker-groups/worker-group-queues.ts b/packages/server/api/src/app/workers/worker-groups/worker-group-queues.ts
index f0fd19d24c9..174f8f61228 100644
--- a/packages/server/api/src/app/workers/worker-groups/worker-group-queues.ts
+++ b/packages/server/api/src/app/workers/worker-groups/worker-group-queues.ts
@@ -32,7 +32,7 @@ const getQueueName = ({ scope, workerGroupId }: GetQueueNameParams): string => {
}
const isRoutableWorkerGroupId = (value: string): boolean => {
- return value.length > 0 && value !== NO_WORKER_GROUP_SENTINEL
+ return value.length > 0 && value !== NO_WORKER_GROUP_SENTINEL && !value.includes(':')
}
export const workerGroupQueues = {
diff --git a/packages/server/api/src/app/workers/worker-groups/worker-group.controller.ts b/packages/server/api/src/app/workers/worker-groups/worker-group.controller.ts
index 341e6e7f75c..e5a8a81a907 100644
--- a/packages/server/api/src/app/workers/worker-groups/worker-group.controller.ts
+++ b/packages/server/api/src/app/workers/worker-groups/worker-group.controller.ts
@@ -1,16 +1,27 @@
-import { ActivepiecesError, ApId, ErrorCode, isNil } from '@activepieces/core-utils'
-import { PrincipalType, SERVICE_KEY_SECURITY_OPENAPI, WorkerGroupScope } from '@activepieces/shared'
+import { ActivepiecesError, ErrorCode } from '@activepieces/core-utils'
+import {
+ AssignWorkerGroupFlowsRequest,
+ AssignWorkerGroupProjectsRequest,
+ ListWorkerGroupFlowsRequest,
+ ListWorkerGroupProjectsRequest,
+ MoveAllWorkerGroupRequest,
+ PrincipalType,
+ SERVICE_KEY_SECURITY_OPENAPI,
+ WorkerGroupFlowAssignmentPage,
+ WorkerGroupMoveResult,
+ WorkerGroupProjectAssignmentPage,
+ WorkerGroupScope,
+ WorkerGroupsOverview,
+} from '@activepieces/shared'
import { FastifyBaseLogger } from 'fastify'
import { FastifyPluginAsyncZod } from 'fastify-type-provider-zod'
import { StatusCodes } from 'http-status-codes'
import { z } from 'zod'
import { securityAccess } from '../../core/security/authorization/fastify-security'
-import { flowRepo } from '../../flows/flow/flow.repo'
-import { projectService } from '../../project/project-service'
import { machineService } from '../machine/machine-service'
import { flowWorkerGroupService } from './flow-worker-group.service'
import { platformWorkerGroupService } from './platform-worker-group.service'
-import { projectWorkerGroupService } from './project-worker-group.service'
+import { workerGroupAssignmentService } from './worker-group-assignment.service'
export const workerGroupController: FastifyPluginAsyncZod = async (app) => {
app.get('/', ListWorkerGroupsRequestOptions, async (request) => {
@@ -18,46 +29,57 @@ export const workerGroupController: FastifyPluginAsyncZod = async (app) => {
return machineService(request.log).listWorkerGroups()
})
- app.get('/flows', ListWorkerGroupFlowsRequestOptions, async (request) => {
+ app.get('/overview', OverviewRequestOptions, async (request) => {
await assertWorkerGroupsEnabled(request.principal.platform.id, request.log)
- return flowWorkerGroupService(request.log).listGroupFlows({
+ return workerGroupAssignmentService(request.log).overview({ platformId: request.principal.platform.id })
+ })
+
+ app.get('/assignments/projects', ListAssignedProjectsRequestOptions, async (request) => {
+ await assertWorkerGroupsEnabled(request.principal.platform.id, request.log)
+ return workerGroupAssignmentService(request.log).listProjects({ platformId: request.principal.platform.id, request: request.query })
+ })
+
+ app.get('/assignments/flows', ListAssignedFlowsRequestOptions, async (request) => {
+ await assertWorkerGroupsEnabled(request.principal.platform.id, request.log)
+ return workerGroupAssignmentService(request.log).listFlows({ platformId: request.principal.platform.id, request: request.query })
+ })
+
+ app.post('/assignments/projects', AssignProjectsRequestOptions, async (request) => {
+ await assertWorkerGroupsEnabled(request.principal.platform.id, request.log)
+ return workerGroupAssignmentService(request.log).assignProjects({
platformId: request.principal.platform.id,
- workerGroupId: request.query.workerGroupId,
+ projectIds: request.body.projects,
+ workerGroupId: request.body.workerGroupId,
})
})
- app.post('/projects/:id', UpdateProjectWorkerGroupRequestOptions, async (request, reply) => {
- const platformId = request.principal.platform.id
- await assertWorkerGroupsEnabled(platformId, request.log)
- await projectWorkerGroupService(request.log).assignProjectToGroup({
- projectId: request.params.id,
- platformId,
+ app.post('/assignments/flows', AssignFlowsRequestOptions, async (request) => {
+ await assertWorkerGroupsEnabled(request.principal.platform.id, request.log)
+ return workerGroupAssignmentService(request.log).assignFlows({
+ platformId: request.principal.platform.id,
+ flowIds: request.body.flows,
workerGroupId: request.body.workerGroupId,
})
- return reply.status(StatusCodes.OK).send()
})
- app.post('/flows/:id', UpdateFlowWorkerGroupRequestOptions, async (request, reply) => {
- const flow = await flowRepo().findOneBy({ id: request.params.id })
- const platformId = isNil(flow) ? null : await projectService(request.log).getPlatformId(flow.projectId)
- if (isNil(flow) || platformId !== request.principal.platform.id) {
- throw new ActivepiecesError({
- code: ErrorCode.ENTITY_NOT_FOUND,
- params: {
- entityId: request.params.id,
- entityType: 'flow',
- },
- })
- }
- await assertWorkerGroupsEnabled(platformId, request.log)
- await flowWorkerGroupService(request.log).assignFlowToGroup({
- flowId: flow.id,
- projectId: flow.projectId,
- platformId,
- workerGroupId: request.body.workerGroupId,
+ app.post('/assignments/move-all', MoveAllRequestOptions, async (request) => {
+ await assertWorkerGroupsEnabled(request.principal.platform.id, request.log)
+ return workerGroupAssignmentService(request.log).moveAll({
+ platformId: request.principal.platform.id,
+ from: request.body.from,
+ to: request.body.to,
+ scope: request.body.scope,
+ })
+ })
+
+ app.get('/flows', ListWorkerGroupFlowsRequestOptions, async (request) => {
+ await assertWorkerGroupsEnabled(request.principal.platform.id, request.log)
+ return flowWorkerGroupService(request.log).listGroupFlows({
+ platformId: request.principal.platform.id,
+ workerGroupId: request.query.workerGroupId,
})
- return reply.status(StatusCodes.OK).send()
})
+
}
async function assertWorkerGroupsEnabled(platformId: string, log: FastifyBaseLogger): Promise<void> {
@@ -72,10 +94,6 @@ async function assertWorkerGroupsEnabled(platformId: string, log: FastifyBaseLog
}
}
-const WorkerGroupAssignmentBody = z.object({
- workerGroupId: z.string().min(1).nullable(),
-})
-
const ListWorkerGroupsRequestOptions = {
config: {
security: securityAccess.platformAdminOnly([PrincipalType.USER, PrincipalType.SERVICE]),
@@ -121,32 +139,71 @@ const ListWorkerGroupFlowsRequestOptions = {
},
}
-const UpdateProjectWorkerGroupRequestOptions = {
- config: {
- security: securityAccess.platformAdminOnly([PrincipalType.USER, PrincipalType.SERVICE]),
+const adminOnly = {
+ security: securityAccess.platformAdminOnly([PrincipalType.USER, PrincipalType.SERVICE]),
+}
+
+const OverviewRequestOptions = {
+ config: adminOnly,
+ schema: {
+ tags: ['worker-groups'],
+ security: [SERVICE_KEY_SECURITY_OPENAPI],
+ description: 'Worker groups with their health and how many projects and flows run on each',
+ response: { [StatusCodes.OK]: WorkerGroupsOverview },
},
+}
+
+const ListAssignedProjectsRequestOptions = {
+ config: adminOnly,
schema: {
tags: ['worker-groups'],
security: [SERVICE_KEY_SECURITY_OPENAPI],
- description: 'Assign a project to a worker group',
- params: z.object({
- id: ApId,
- }),
- body: WorkerGroupAssignmentBody,
+ description: 'List the projects that run on a worker group, one page at a time',
+ querystring: ListWorkerGroupProjectsRequest,
+ response: { [StatusCodes.OK]: WorkerGroupProjectAssignmentPage },
},
}
-const UpdateFlowWorkerGroupRequestOptions = {
- config: {
- security: securityAccess.platformAdminOnly([PrincipalType.USER, PrincipalType.SERVICE]),
+const ListAssignedFlowsRequestOptions = {
+ config: adminOnly,
+ schema: {
+ tags: ['worker-groups'],
+ security: [SERVICE_KEY_SECURITY_OPENAPI],
+ description: 'List the flows pinned to a worker group, or the flows of one project, one page at a time',
+ querystring: ListWorkerGroupFlowsRequest,
+ response: { [StatusCodes.OK]: WorkerGroupFlowAssignmentPage },
},
+}
+
+const AssignProjectsRequestOptions = {
+ config: adminOnly,
schema: {
tags: ['worker-groups'],
security: [SERVICE_KEY_SECURITY_OPENAPI],
- description: 'Assign a flow to a worker group',
- params: z.object({
- id: ApId,
- }),
- body: WorkerGroupAssignmentBody,
+ description: 'Move projects to a worker group; waiting runs move with them',
+ body: AssignWorkerGroupProjectsRequest,
+ response: { [StatusCodes.OK]: WorkerGroupMoveResult },
+ },
+}
+
+const AssignFlowsRequestOptions = {
+ config: adminOnly,
+ schema: {
+ tags: ['worker-groups'],
+ security: [SERVICE_KEY_SECURITY_OPENAPI],
+ description: 'Move flows to a worker group; waiting runs move with them',
+ body: AssignWorkerGroupFlowsRequest,
+ response: { [StatusCodes.OK]: WorkerGroupMoveResult },
+ },
+}
+
+const MoveAllRequestOptions = {
+ config: adminOnly,
+ schema: {
+ tags: ['worker-groups'],
+ security: [SERVICE_KEY_SECURITY_OPENAPI],
+ description: 'Move every project or every pinned flow off a worker group; waiting runs move with them',
+ body: MoveAllWorkerGroupRequest,
+ response: { [StatusCodes.OK]: WorkerGroupMoveResult },
},
}
diff --git a/packages/server/api/test/integration/ce/flows/flow/flow.test.ts b/packages/server/api/test/integration/ce/flows/flow/flow.test.ts
index 22b39b0a088..cca12cdf642 100644
--- a/packages/server/api/test/integration/ce/flows/flow/flow.test.ts
+++ b/packages/server/api/test/integration/ce/flows/flow/flow.test.ts
@@ -52,7 +52,7 @@ describe('Flow API', () => {
expect(response?.statusCode).toBe(StatusCodes.CREATED)
const responseBody = response?.json()
- expect(Object.keys(responseBody)).toHaveLength(15)
+ expect(Object.keys(responseBody)).toHaveLength(16)
expect(responseBody?.id).toHaveLength(21)
expect(responseBody?.created).toBeDefined()
expect(responseBody?.updated).toBeDefined()
@@ -64,6 +64,7 @@ describe('Flow API', () => {
expect(responseBody?.operationStatus).toBeDefined()
expect(responseBody?.templateId).toBeNull()
expect(responseBody?.createdBy).toBeNull()
+ expect(responseBody?.workerGroupId).toBeNull()
expect(Object.keys(responseBody?.version)).toHaveLength(14)
expect(responseBody?.version?.id).toHaveLength(21)
diff --git a/packages/server/api/test/integration/ce/workers/worker-group-assignments.test.ts b/packages/server/api/test/integration/ce/workers/worker-group-assignments.test.ts
new file mode 100644
index 00000000000..faff875a47a
--- /dev/null
+++ b/packages/server/api/test/integration/ce/workers/worker-group-assignments.test.ts
@@ -0,0 +1,164 @@
+import { apId } from '@activepieces/core-utils'
+import { DefaultProjectRole, FlowStatus, LATEST_JOB_DATA_SCHEMA_VERSION, WorkerGroupScope, WorkerJobType } from '@activepieces/shared'
+import { FastifyInstance } from 'fastify'
+import { StatusCodes } from 'http-status-codes'
+import { jobQueue } from '../../../../src/app/workers/job-queue/job-queue'
+import { workerGroupQueues } from '../../../../src/app/workers/worker-groups/worker-group-queues'
+import { db } from '../../../helpers/db'
+import { createMockFlow, createMockFlowVersion, createMockProject } from '../../../helpers/mocks'
+import { createMemberContext, createTestContext, TestContext } from '../../../helpers/test-context'
+import { setupTestEnvironment, teardownTestEnvironment } from '../../../helpers/test-setup'
+
+let app: FastifyInstance
+
+beforeAll(async () => {
+ app = await setupTestEnvironment()
+})
+
+afterAll(async () => {
+ await teardownTestEnvironment()
+})
+
+describe('worker group assignments', () => {
+ it('never shows or moves another platform\'s projects and flows', async () => {
+ const mine = await createTestContext(app, { plan: { workerGroupsEnabled: true } })
+ const theirs = await createTestContext(app, { plan: { workerGroupsEnabled: true } })
+ const foreignFlow = await seedFlow({ ctx: theirs, name: 'Shared secret sync' })
+
+ const flows = await mine.get('/v1/worker-groups/assignments/flows', { filter: 'all', search: 'Shared secret' })
+ const list = await mine.get('/v1/worker-groups/assignments/projects', { filter: 'all' })
+ const moveProjects = await mine.post('/v1/worker-groups/assignments/projects', { projects: [theirs.project.id], workerGroupId: 'gpu' })
+ const moveFlows = await mine.post('/v1/worker-groups/assignments/flows', { flows: [foreignFlow.id], workerGroupId: 'gpu' })
+
+ expect(flows.json().data).toEqual([])
+ expect(list.json().data.map((p: { id: string }) => p.id)).not.toContain(theirs.project.id)
+ expect(moveProjects.statusCode).toBe(StatusCodes.NOT_FOUND)
+ expect(moveFlows.statusCode).toBe(StatusCodes.NOT_FOUND)
+ expect((await db.findOneByOrFail<{ workerGroupId: string | null }>('project', { id: theirs.project.id })).workerGroupId).toBeNull()
+ expect((await db.findOneByOrFail<{ workerGroupId: string | null }>('flow', { id: foreignFlow.id })).workerGroupId).toBeNull()
+ })
+
+ it('overview names the first projects and flows on each group, from this platform only', async () => {
+ const mine = await createTestContext(app, { plan: { workerGroupsEnabled: true } })
+ const theirs = await createTestContext(app, { plan: { workerGroupsEnabled: true } })
+ const projectGroup = `eu_${apId().toLowerCase()}`
+ const flowGroup = `gpu_${apId().toLowerCase()}`
+ await db.save('project', [
+ createMockProject({ platformId: mine.platform.id, ownerId: mine.user.id, workerGroupId: projectGroup, displayName: 'Beta' }),
+ createMockProject({ platformId: mine.platform.id, ownerId: mine.user.id, workerGroupId: projectGroup, displayName: 'Alpha' }),
+ createMockProject({ platformId: theirs.platform.id, ownerId: theirs.user.id, workerGroupId: projectGroup, displayName: 'Aardvark' }),
+ createMockProject({ platformId: mine.platform.id, ownerId: mine.user.id, workerGroupId: null, displayName: 'AAA ungrouped' }),
+ ])
+ await seedFlow({ ctx: mine, name: 'Nightly export', workerGroupId: flowGroup })
+ await seedFlow({ ctx: theirs, name: 'A foreign flow', workerGroupId: flowGroup })
+
+ const response = await mine.get('/v1/worker-groups/overview')
+
+ expect(response.statusCode).toBe(StatusCodes.OK)
+ const groups = response.json().groups as { label: string, sample?: string[] }[]
+ expect(groups.find((g) => g.label === projectGroup)).toMatchObject({ scope: 'project', projectCount: 2 })
+ expect([...(groups.find((g) => g.label === projectGroup)?.sample ?? [])].sort()).toEqual(['Alpha', 'Beta'])
+ expect(groups.find((g) => g.label === flowGroup)).toMatchObject({ scope: 'flow', flowCount: 1, sample: ['Nightly export'] })
+ expect(response.json().defaultGroup.sample).toContain('AAA ungrouped')
+ })
+
+ it('overview keeps a project group and a flow group with the same name apart', async () => {
+ const ctx = await createTestContext(app, { plan: { workerGroupsEnabled: true } })
+ const label = `gpu_${apId().toLowerCase()}`
+ const project = createMockProject({ platformId: ctx.platform.id, ownerId: ctx.user.id, workerGroupId: label })
+ await db.save('project', project)
+ await seedFlow({ ctx, projectId: project.id, name: 'Inherits the project group' })
+ await seedFlow({ ctx, projectId: project.id, name: 'Pinned to the flow group', workerGroupId: label })
+
+ const response = await ctx.get('/v1/worker-groups/overview')
+
+ const groups = (response.json().groups as { label: string }[]).filter((g) => g.label === label)
+ expect(groups).toEqual([
+ expect.objectContaining({ scope: 'flow', projectCount: 0, flowCount: 1, sample: ['Pinned to the flow group'] }),
+ expect.objectContaining({ scope: 'project', projectCount: 1, flowCount: 1 }),
+ ])
+ })
+
+ it.each(['__none__', 'gpu:eu'])('rejects the group name %s the queues cannot use and changes nothing', async (workerGroupId) => {
+ const ctx = await createTestContext(app, { plan: { workerGroupsEnabled: true } })
+
+ const response = await ctx.post('/v1/worker-groups/assignments/projects', { projects: [ctx.project.id], workerGroupId })
+
+ expect(response.statusCode).toBe(StatusCodes.CONFLICT)
+ expect((await db.findOneByOrFail<{ workerGroupId: string | null }>('project', { id: ctx.project.id })).workerGroupId).toBeNull()
+ })
+
+ it.each([
+ ['GET', '/v1/worker-groups/overview'],
+ ['POST', '/v1/worker-groups/assignments/move-all'],
+ ])('%s %s is closed without the plan and to non-admins', async (method, url) => {
+ const withoutPlan = await createTestContext(app, { plan: { workerGroupsEnabled: false } })
+ const withPlan = await createTestContext(app, { plan: { workerGroupsEnabled: true } })
+ const member = await createMemberContext(app, withPlan, { projectRole: DefaultProjectRole.ADMIN })
+ const body = { from: 'gpu', to: null, scope: WorkerGroupScope.PROJECT }
+
+ const send = (ctx: TestContext) => method === 'GET' ? ctx.get(url) : ctx.post(url, body)
+
+ expect((await send(withoutPlan)).statusCode).toBe(StatusCodes.PAYMENT_REQUIRED)
+ expect((await send(member)).statusCode).toBe(StatusCodes.FORBIDDEN)
+ })
+
+ it('move-all with project scope moves the projects and their waiting runs, not the flows pinned to the same name', async () => {
+ const ctx = await createTestContext(app, { plan: { workerGroupsEnabled: true } })
+ const from = `drain_${apId().toLowerCase()}`
+ const to = `spare_${apId().toLowerCase()}`
+ const movingProject = createMockProject({ platformId: ctx.platform.id, ownerId: ctx.user.id, workerGroupId: from })
+ const stayingProject = createMockProject({ platformId: ctx.platform.id, ownerId: ctx.user.id, workerGroupId: null })
+ await db.save('project', [movingProject, stayingProject])
+ const pinnedFlow = await seedFlow({ ctx, projectId: stayingProject.id, workerGroupId: from })
+
+ const fromQueue = await jobQueue(app.log).getOrCreateQueue({ queueName: workerGroupQueues.getQueueName({ scope: WorkerGroupScope.PROJECT, workerGroupId: from }) })
+ const toQueue = await jobQueue(app.log).getOrCreateQueue({ queueName: workerGroupQueues.getQueueName({ scope: WorkerGroupScope.PROJECT, workerGroupId: to }) })
+ await fromQueue.add('moving', buildRunJob({ platformId: ctx.platform.id, projectId: movingProject.id }), { jobId: apId() })
+ await fromQueue.add('other-platform', buildRunJob({ platformId: apId(), projectId: apId() }), { jobId: apId() })
+
+ const response = await ctx.post('/v1/worker-groups/assignments/move-all', { from, to, scope: WorkerGroupScope.PROJECT })
+
+ expect(response.statusCode).toBe(StatusCodes.OK)
+ expect(response.json()).toMatchObject({ movedWaitingRuns: 1, projects: [movingProject.id], flows: [] })
+ expect((await db.findOneByOrFail<{ workerGroupId: string | null }>('project', { id: movingProject.id })).workerGroupId).toBe(to)
+ expect((await db.findOneByOrFail<{ workerGroupId: string | null }>('project', { id: stayingProject.id })).workerGroupId).toBeNull()
+ expect((await db.findOneByOrFail<{ workerGroupId: string | null }>('flow', { id: pinnedFlow.id })).workerGroupId).toBe(from)
+ expect((await toQueue.getJobs(['waiting'])).map((job) => job.name)).toEqual(['moving'])
+ expect((await fromQueue.getJobs(['waiting'])).map((job) => job.name)).toEqual(['other-platform'])
+ await fromQueue.obliterate({ force: true })
+ await toQueue.obliterate({ force: true })
+ })
+
+ it('rejects pages above the limit and clamps a cursor past the end to the last page', async () => {
+ const ctx = await createTestContext(app, { plan: { workerGroupsEnabled: true } })
+ const group = `bulk_${apId().toLowerCase()}`
+ const projects = Array.from({ length: 5 }, (_, i) => createMockProject({ platformId: ctx.platform.id, ownerId: ctx.user.id, displayName: `p${i}`, workerGroupId: group }))
+ await db.save('project', projects)
+
+ const tooBig = await ctx.get('/v1/worker-groups/assignments/projects', { group, limit: '101' })
+ const pastEnd = await ctx.get('/v1/worker-groups/assignments/projects', { group, limit: '2', cursor: '8' })
+
+ expect(tooBig.statusCode).toBe(StatusCodes.BAD_REQUEST)
+ expect(pastEnd.json()).toMatchObject({ offset: 4, total: 5, next: null, previous: '2' })
+ const lastById = [...projects].sort((a, b) => (a.id < b.id ? -1 : 1))[4]
+ expect(pastEnd.json().data.map((p: { id: string }) => p.id)).toEqual([lastById.id])
+ })
+})
+
+async function seedFlow({ ctx, projectId, name, workerGroupId = null }: { ctx: TestContext, projectId?: string, name?: string, workerGroupId?: string | null }) {
+ const flow = createMockFlow({ projectId: projectId ?? ctx.project.id, status: FlowStatus.ENABLED })
+ await db.save('flow', { ...flow, workerGroupId })
+ await db.save('flow_version', createMockFlowVersion({ flowId: flow.id, displayName: name ?? 'flow' }))
+ return flow
+}
+
+function buildRunJob({ platformId, projectId }: { platformId: string, projectId: string }) {
+ return {
+ projectId,
+ platformId,
+ flowId: apId(),
+ schemaVersion: LATEST_JOB_DATA_SCHEMA_VERSION,
+ jobType: WorkerJobType.EXECUTE_FLOW,
+ }
+}
diff --git a/packages/server/api/test/unit/app/workers/job-queue/interceptors/rate-limiter-interceptor.test.ts b/packages/server/api/test/unit/app/workers/job-queue/interceptors/rate-limiter-interceptor.test.ts
index 91d14a98738..264f7e107c2 100644
--- a/packages/server/api/test/unit/app/workers/job-queue/interceptors/rate-limiter-interceptor.test.ts
+++ b/packages/server/api/test/unit/app/workers/job-queue/interceptors/rate-limiter-interceptor.test.ts
@@ -18,6 +18,13 @@ vi.mock('../../../../../../src/app/workers/worker-groups/flow-worker-group.servi
}),
}))
+const mockIsWorkerGroupsEnabled = vi.fn()
+vi.mock('../../../../../../src/app/workers/worker-groups/platform-worker-group.service', () => ({
+ platformWorkerGroupService: () => ({
+ isWorkerGroupsEnabled: (...args: unknown[]) => mockIsWorkerGroupsEnabled(...args),
+ }),
+}))
+
const mockLog: FastifyBaseLogger = {
debug: vi.fn(),
info: vi.fn(),
@@ -78,6 +85,7 @@ describe('rateLimiterInterceptor', () => {
beforeEach(async () => {
vi.restoreAllMocks()
mockGetFlowWorkerGroup.mockResolvedValue(null)
+ mockIsWorkerGroupsEnabled.mockResolvedValue(false)
enableRateLimiter()
vi.spyOn(system, 'getNumberOrThrow').mockImplementation((prop) => {
if (prop === AppSystemProp.FLOW_TIMEOUT_SECONDS) return 600
@@ -132,7 +140,11 @@ describe('rateLimiterInterceptor', () => {
})
describe('flow worker group pin', () => {
- it('should ignore the project pool limit but still enforce the plan limit', async () => {
+ beforeEach(() => {
+ mockIsWorkerGroupsEnabled.mockResolvedValue(true)
+ })
+
+ it('should ignore the project pool limit, enforce the plan limit, and not contend with ordinary runs', async () => {
const redis = await redisConnections.useExisting()
vi.spyOn(system, 'getNumberOrThrow').mockImplementation((prop) => {
if (prop === AppSystemProp.FLOW_TIMEOUT_SECONDS) return 600
@@ -153,12 +165,32 @@ describe('rateLimiterInterceptor', () => {
mockGetFlowWorkerGroup.mockResolvedValue('g1')
const pinned = await rateLimiterInterceptor.preDispatch({ jobId: 'pin-c', jobData, job: createMockJob(), log: mockLog })
expect(pinned.verdict).toBe(InterceptorVerdict.ALLOW)
- expect(await redis.zcard(getConcurrencyPoolSetKey(poolId))).toBe(2)
+ // Pinned runs get their own flow-group pool — the project pool (limit=1) still holds only pin-a.
+ expect(await redis.zcard(getConcurrencyPoolSetKey(poolId))).toBe(1)
+ expect(await redis.zcard(getConcurrencyPoolSetKey('flow-group:g1'))).toBe(1)
- const pinnedOverPlan = await rateLimiterInterceptor.preDispatch({ jobId: 'pin-d', jobData, job: createMockJob(), log: mockLog })
+ const pinnedWithinPlan = await rateLimiterInterceptor.preDispatch({ jobId: 'pin-d', jobData, job: createMockJob(), log: mockLog })
+ expect(pinnedWithinPlan.verdict).toBe(InterceptorVerdict.ALLOW)
+ const pinnedOverPlan = await rateLimiterInterceptor.preDispatch({ jobId: 'pin-e', jobData, job: createMockJob(), log: mockLog })
expect(pinnedOverPlan.verdict).toBe(InterceptorVerdict.REJECT)
})
+ it('a pinned run does not block ordinary project runs at the project pool limit', async () => {
+ const projectId = `proj-${crypto.randomUUID()}`
+ const poolId = `pool-${crypto.randomUUID()}`
+ const jobData = createFlowJobData({ projectId })
+ await distributedStore.put(getProjectConcurrencyPoolKey(projectId), poolId)
+ await distributedStore.put(getConcurrencyPoolLimitKey(poolId), 1)
+
+ mockGetFlowWorkerGroup.mockResolvedValue('g1')
+ const pinned = await rateLimiterInterceptor.preDispatch({ jobId: 'pin-first', jobData, job: createMockJob(), log: mockLog })
+ expect(pinned.verdict).toBe(InterceptorVerdict.ALLOW)
+
+ mockGetFlowWorkerGroup.mockResolvedValue(null)
+ const ordinary = await rateLimiterInterceptor.preDispatch({ jobId: 'ordinary-first', jobData, job: createMockJob(), log: mockLog })
+ expect(ordinary.verdict).toBe(InterceptorVerdict.ALLOW)
+ })
+
it('should rate limit normally when the flow group lookup fails', async () => {
vi.spyOn(system, 'getNumberOrThrow').mockImplementation((prop) => {
if (prop === AppSystemProp.FLOW_TIMEOUT_SECONDS) return 600
@@ -179,10 +211,10 @@ describe('rateLimiterInterceptor', () => {
const jobData = createFlowJobData()
const first = await rateLimiterInterceptor.preDispatch({ jobId: 'rel-a', jobData, job: createMockJob(), log: mockLog })
expect(first.verdict).toBe(InterceptorVerdict.ALLOW)
- expect(await redis.zcard(getConcurrencyPoolSetKey(jobData.projectId))).toBe(1)
+ expect(await redis.zcard(getConcurrencyPoolSetKey('flow-group:g1'))).toBe(1)
await rateLimiterInterceptor.onJobFinished({ jobId: 'rel-a', jobData, failed: false, log: mockLog })
- expect(await redis.zcard(getConcurrencyPoolSetKey(jobData.projectId))).toBe(0)
+ expect(await redis.zcard(getConcurrencyPoolSetKey('flow-group:g1'))).toBe(0)
})
})
diff --git a/packages/server/api/test/unit/app/workers/worker-groups/worker-group-queues.test.ts b/packages/server/api/test/unit/app/workers/worker-groups/worker-group-queues.test.ts
index 62952147c93..62ca232a50e 100644
--- a/packages/server/api/test/unit/app/workers/worker-groups/worker-group-queues.test.ts
+++ b/packages/server/api/test/unit/app/workers/worker-groups/worker-group-queues.test.ts
@@ -32,6 +32,7 @@ describe('workerGroupQueues.isRoutableWorkerGroupId', () => {
it('rejects values no worker can ever claim', () => {
expect(workerGroupQueues.isRoutableWorkerGroupId('')).toBe(false)
expect(workerGroupQueues.isRoutableWorkerGroupId('__none__')).toBe(false)
+ expect(workerGroupQueues.isRoutableWorkerGroupId('gpu:eu')).toBe(false)
})
it('accepts ordinary labels', () => {
diff --git a/packages/web/public/locales/de/translation.json b/packages/web/public/locales/de/translation.json
index 225144bfe73..0af26f53ba2 100644
--- a/packages/web/public/locales/de/translation.json
+++ b/packages/web/public/locales/de/translation.json
@@ -1554,28 +1554,13 @@
"No trigger data available": "Keine Trigger-Daten verfügbar",
"Trigger health information will appear here": "Gesundheitsinformationen werden hier angezeigt",
"trigger status": "trigger status",
- "in this group": "in this group",
- "currently in {group} — will move here": "currently in {group} — will move here",
- "shared queue": "shared queue",
- "Assign projects": "Assign projects",
"These projects will run on this group's dedicated queue.": "These projects will run on this group's dedicated queue.",
- "No projects": "No projects",
- "{count, plural, =1 {worker} other {workers}}": "{count, plural, =1 {worker} other {workers}}",
- "{count} total concurrencies": "{count} total concurrencies",
- "Assign": "Assign",
"+{count} more": "+{count} mehr",
- "Allocate capacity per project — pick its worker group and concurrency limit. Leave the limit empty to inherit the platform default. Project settings shows these read-only and links here.": "Allocate capacity per project — pick its worker group and concurrency limit. Leave the limit empty to inherit the platform default. Project settings shows these read-only and links here.",
"projects": "projekte",
- "No projects yet": "No projects yet",
"Start by creating projects to manage your automation teams": "Beginnen Sie mit der Erstellung von Projekten, um Ihre Automatisierungsteams zu verwalten",
- "Assigned worker": "Assigned worker",
"Concurrency limit": "Concurrency limit",
"Saved": "Saved",
- "Failed to save": "Failed to save",
"Shared": "Gemeinsam genutzt",
- "{group} has no workers online. Runs will wait in its queue": "{group} has no workers online. Runs will wait in its queue",
- "Default {count}": "Default {count}",
- "Concurrency limit must be a positive number": "Concurrency limit must be a positive number",
"Check the health of your workers": "Prüfen Sie die Gesundheit Ihrer Mitarbeiter",
"Upgrade to Dedicated Workers": "Upgrade auf dedizierte Arbeiter",
"Your automations run on shared workers where strict sandboxing adds overhead to every execution. Dedicated workers give you your own execution pool that stays warm and ready, so your automations start much faster.": "Ihre Automatisierungen laufen auf geteilten Arbeitnehmern, wo strenge Sandboxen zu jeder Ausführung einen Overhead hinzufügt. Dedizierte Arbeiter geben Ihnen Ihren eigenen Hinrichtungspool, der warm und bereit bleibt, so dass Ihre Automatisierungen viel schneller starten.",
@@ -1583,8 +1568,6 @@
"Your workers run exclusively for your platform. The execution pool stays warm with no sandboxing overhead, so your automations start instantly.": "Ihre Mitarbeiter arbeiten ausschließlich für Ihre Plattform. Der Ausführungspool bleibt warm ohne Sandbox-Overhead, so dass Ihre Automatisierung sofort beginnt.",
"No workers found": "Keine Arbeiter gefunden",
"You don't have any workers yet. Spin up new workers to execute your automations": "Sie haben noch keine Mitarbeiter. Spülen Sie neue Mitarbeiter um Ihre Automatisierungen auszuführen",
- "Unlock Worker Groups": "Unlock Worker Groups",
- "Reserve dedicated worker capacity for specific projects so a busy project never slows down the rest": "Reserve dedicated worker capacity for specific projects so a busy project never slows down the rest",
"Dedicated": "Dediziert",
"This worker runs the projects assigned to the {group} group.": "This worker runs the projects assigned to the {group} group.",
"This worker runs exclusively for your platform with no sandboxing overhead.": "Dieser Arbeiter läuft ausschließlich für Ihre Plattform ohne Sandbox-Overhead.",
@@ -1598,9 +1581,6 @@
"Box": "Box",
"Busy": "Besetzt",
"Idle": "Idle",
- "Worker groups reserve a dedicated queue for the projects you assign. Defined in your deployment with AP_WORKER_GROUP_ID.": "Worker groups reserve a dedicated queue for the projects you assign. Defined in your deployment with AP_WORKER_GROUP_ID.",
- "By project": "By project",
- "By group": "By group",
"Configs": "Einstellungen",
"Variable": "Variable",
"Created": "Erstellt",
@@ -3378,5 +3358,148 @@
"People can no longer sign in with email and password.": "People can no longer sign in with email and password.",
"Couldn't disable single sign-on": "Couldn't disable single sign-on",
"Couldn't save single sign-on settings": "Couldn't save single sign-on settings",
- "To change the connection, paste both values again.": "To change the connection, paste both values again."
-}
\ No newline at end of file
+ "To change the connection, paste both values again.": "To change the connection, paste both values again.",
+ "Worker groups guide": "",
+ "Start a worker": "",
+ "Unlock worker groups": "",
+ "Set aside servers for specific projects or flows, so a busy project never slows down the rest.": "",
+ "Add projects": "",
+ "Add flows": "",
+ "Add {count, plural, =1 {1 project} other {# projects}}": "",
+ "Add {count, plural, =1 {1 flow} other {# flows}}": "",
+ "Add projects to {group}": "",
+ "Add flows to {group}": "",
+ "The projects you pick, and their flows, will run on this group.": "",
+ "The flows you pick will run on this group instead of their project’s group.": "",
+ "Now on {group}": "",
+ "Nothing matches your search.": "",
+ "Nothing to add.": "",
+ "This group has no workers online. Runs will wait until a worker is back.": "",
+ "first {shown} of {total} shown, search to find others": "",
+ "Find a project": "",
+ "No projects match your search.": "",
+ "Flow groups": "",
+ "Project groups": "",
+ "Only the flows picked here run on these servers. Their projects stay where they are.": "",
+ "Each project here runs with all its flows, unless a flow has its own group.": "",
+ "{count, plural, =1 {1 flow} other {{countText} flows}}": "",
+ "{count, plural, =1 {1 project} other {{countText} projects}}": "",
+ "View projects": "",
+ "not in a group": "",
+ "{count, plural, =1 {1 run waiting} other {# runs waiting}}": "",
+ "{count, plural, =1 {1 worker online} other {# workers online}}": "",
+ "No workers online": "",
+ "Not in use": "",
+ "Concurrency {count, number}": "",
+ "No runs waiting": "",
+ "No workers use this name": "",
+ "Nothing yet": "",
+ "+{count, number} more": "",
+ "Open": "",
+ "Open {group}": "",
+ "All groups": "",
+ "Group not found": "",
+ "No worker group called {name} exists on this platform. It may have been renamed, or its workers stopped.": "",
+ "Back to all groups": "",
+ "Projects that are not in a group run here, with their flows.": "",
+ "Only the flows listed here run on this group. Their projects stay where they are.": "",
+ "The projects listed here run on this group, with all their flows, unless a flow has its own group.": "",
+ "Workers join this group with": "",
+ "Move all to…": "",
+ "Runs sent here wait until a worker is back. Move its flows to another group to keep them running.": "",
+ "Runs sent here wait until a worker is back. Move its projects to another group to keep them running.": "",
+ "No flows run on this group yet. Use Add flows to pick some.": "",
+ "Every project is in a group.": "",
+ "No projects run on this group yet. Use Add projects to pick some.": "",
+ "Could not move. Nothing was changed.": "",
+ "Move undone.": "",
+ "Could not undo the move.": "",
+ "{project} now uses the default concurrency limit.": "",
+ "{project} now has a concurrency limit of {count, number}.": "",
+ "Could not save the concurrency limit. Nothing was changed.": "",
+ "Shared workers": "",
+ "{workers, plural, =1 {1 worker} other {# workers}} · concurrency {slots, number}": "",
+ "{projects, plural, =1 {1 project} other {{projectsText} projects}} · {flows, plural, =1 {1 flow} other {{flowsText} flows}}": "",
+ "{flows, plural, =1 {1 flow} other {{flowsText} flows}}": "",
+ "Moved {projects, plural, =1 {1 project} other {# projects}} and {flows, plural, =1 {1 flow} other {# flows}} to {group}.": "",
+ "Moved {count, plural, =1 {1 project} other {# projects}} to {group}.": "",
+ "Moved {count, plural, =1 {1 flow back to its project group.} other {# flows back to their project groups.}}": "",
+ "Moved {count, plural, =1 {1 flow} other {# flows}} to {group}.": "",
+ "{count, plural, =1 {1 waiting run went with them.} other {# waiting runs went with them.}}": "",
+ "Back to each flow’s project group": "",
+ "{count, plural, =1 {1 flow} other {# flows}}": "",
+ "{projects, plural, =1 {1 project} other {# projects}} ({flows, plural, =1 {1 flow} other {# flows}})": "",
+ "Move {count, plural, =1 {1 selected flow} other {# selected flows}}": "",
+ "Move {count, plural, =1 {1 selected project} other {# selected projects}}": "",
+ "Move all from {group}": "",
+ "{what} will move to the group you pick.": "",
+ "{count, plural, =1 {1 waiting run goes with them.} other {# waiting runs go with them.}}": "",
+ "Find a group": "",
+ "The group {group} has no workers online. Runs will wait there until a worker is back.": "",
+ "Same as project ({group})": "",
+ "Move {subject} to {group}?": "",
+ "{from}–{to} of {total}": "",
+ "Previous page": "",
+ "Next page": "",
+ "All {count, number} selected": "",
+ "Move to…": "",
+ "Select all {count, number}": "",
+ "Move {what} back to their project groups?": "",
+ "Move {what} to {group}?": "",
+ "{count, plural, =1 {1 flow moves with them.} other {# flows move with them.}}": "",
+ "{count, plural, =1 {1 of the picked items is already on {group}.} other {# of the picked items are already on {group}.}}": "",
+ "You can undo this right after.": "",
+ "Worker groups are servers set aside for specific projects or flows. Everything else runs on your shared workers.": "",
+ "No flow groups yet. Flow groups come from workers started for flows.": "",
+ "No project groups yet. Project groups come from workers started for projects.": "",
+ "How to add one": "",
+ "{count, number}": "",
+ "Default ({count, number})": "",
+ "How many runs of {project} can go at the same time. Extra runs wait their turn.": "",
+ "Enter a whole number above 0.": "",
+ "Leave it empty to use the default, {count, number}. The default comes from your plan and the group’s capacity.": "",
+ "search results": "",
+ "Nothing matches {query}.": "",
+ "{count, plural, =1 {1 result} other {{countText} results}}": "",
+ "runs on": "",
+ "in {project} runs on": "",
+ "(the project’s group)": "",
+ "You have no worker groups yet": "",
+ "Right now every project and flow runs on your shared workers. That is fine for most teams.": "",
+ "When a group helps": "",
+ "A busy project slows the others down. Give it its own servers.": "",
+ "A few flows need more memory or a GPU. Send just those flows to bigger servers.": "",
+ "A project must run in one region or network. Keep it on servers there.": "",
+ "Read the guide": "",
+ "Start one or more workers with": "",
+ ", using your own group name.": "",
+ "For a group that runs single flows instead of whole projects, also set": "",
+ "The group shows up here once a worker is online. Then add projects or flows to it.": "",
+ "Worker group": "",
+ "No flows match your search.": "",
+ "Select {name}": "",
+ "View flows": "",
+ "Select all on this page": "",
+ "{count, plural, =1 {1 flow runs on {group}} other {# flows run on {group}}}": "",
+ "{count, plural, =1 {1 flow runs on another group} other {# flows run on other groups}}": "",
+ "{count, plural, =1 {1 flow} other {# flows}} on {group}, which has no workers online": "",
+ "{count, plural, =1 {1 flow} other {# flows}} on {group}": "",
+ "{count, plural, =1 {1 flow moves} other {# flows move}}; {kept, plural, =1 {1 keeps its own group.} other {# keep their own group.}}": "",
+ "{count, plural, =1 {Its 1 flow moves too.} other {Its # flows move too.}}": "",
+ "worker groups": "",
+ "Where does a project or flow run?": "",
+ "Flows in {project}": "",
+ "These flows run on {group}, the project’s group, unless you pick another group for a flow.": "",
+ "This project has no flows.": "",
+ "This group name is not allowed.": "",
+ "2d": "",
+ "First {shown, number} of {total, number}. Type to narrow.": "",
+ "Moved {done, number} of {total, number}. The rest could not be moved.": "",
+ "Nothing was left to move.": "",
+ "canvas": "",
+ "cursor": "",
+ "group": "",
+ "name": "",
+ "q": "",
+ "The most runs of one project at the same time. Flows with their own group are not limited by it. Extra runs wait their turn.": ""
+}
diff --git a/packages/web/public/locales/en/translation.json b/packages/web/public/locales/en/translation.json
index 97293535a03..0ef5c58e048 100644
--- a/packages/web/public/locales/en/translation.json
+++ b/packages/web/public/locales/en/translation.json
@@ -1513,28 +1513,13 @@
"No trigger data available": "No trigger data available",
"Trigger health information will appear here": "Trigger health information will appear here",
"trigger status": "trigger status",
- "in this group": "in this group",
- "currently in {group} — will move here": "currently in {group} — will move here",
- "shared queue": "shared queue",
- "Assign projects": "Assign projects",
"These projects will run on this group's dedicated queue.": "These projects will run on this group's dedicated queue.",
- "No projects": "No projects",
- "{count, plural, =1 {worker} other {workers}}": "{count, plural, =1 {worker} other {workers}}",
- "{count} total concurrencies": "{count} total concurrencies",
- "Assign": "Assign",
"+{count} more": "+{count} more",
- "Allocate capacity per project — pick its worker group and concurrency limit. Leave the limit empty to inherit the platform default. Project settings shows these read-only and links here.": "Allocate capacity per project — pick its worker group and concurrency limit. Leave the limit empty to inherit the platform default. Project settings shows these read-only and links here.",
"projects": "projects",
- "No projects yet": "No projects yet",
"Start by creating projects to manage your automation teams": "Start by creating projects to manage your automation teams",
- "Assigned worker": "Assigned worker",
"Concurrency limit": "Concurrency limit",
"Saved": "Saved",
- "Failed to save": "Failed to save",
"Shared": "Shared",
- "{group} has no workers online. Runs will wait in its queue": "{group} has no workers online. Runs will wait in its queue",
- "Default {count}": "Default {count}",
- "Concurrency limit must be a positive number": "Concurrency limit must be a positive number",
"Check the health of your workers": "Check the health of your workers",
"Upgrade to Dedicated Workers": "Upgrade to Dedicated Workers",
"Your automations run on shared workers where strict sandboxing adds overhead to every execution. Dedicated workers give you your own execution pool that stays warm and ready, so your automations start much faster.": "Your automations run on shared workers where strict sandboxing adds overhead to every execution. Dedicated workers give you your own execution pool that stays warm and ready, so your automations start much faster.",
@@ -1542,8 +1527,6 @@
"Your workers run exclusively for your platform. The execution pool stays warm with no sandboxing overhead, so your automations start instantly.": "Your workers run exclusively for your platform. The execution pool stays warm with no sandboxing overhead, so your automations start instantly.",
"No workers found": "No workers found",
"You don't have any workers yet. Spin up new workers to execute your automations": "You don't have any workers yet. Spin up new workers to execute your automations",
- "Unlock Worker Groups": "Unlock Worker Groups",
- "Reserve dedicated worker capacity for specific projects so a busy project never slows down the rest": "Reserve dedicated worker capacity for specific projects so a busy project never slows down the rest",
"Dedicated": "Dedicated",
"This worker runs the projects assigned to the {group} group.": "This worker runs the projects assigned to the {group} group.",
"This worker runs exclusively for your platform with no sandboxing overhead.": "This worker runs exclusively for your platform with no sandboxing overhead.",
@@ -1557,9 +1540,6 @@
"Box": "Box",
"Busy": "Busy",
"Idle": "Idle",
- "Worker groups reserve a dedicated queue for the projects you assign. Defined in your deployment with AP_WORKER_GROUP_ID.": "Worker groups reserve a dedicated queue for the projects you assign. Defined in your deployment with AP_WORKER_GROUP_ID.",
- "By project": "By project",
- "By group": "By group",
"Configs": "Configs",
"Variable": "Variable",
"Created": "Created",
@@ -3338,6 +3318,149 @@
"Couldn't disable single sign-on": "Couldn't disable single sign-on",
"Couldn't save single sign-on settings": "Couldn't save single sign-on settings",
"To change the connection, paste both values again.": "To change the connection, paste both values again.",
+ "Worker groups guide": "Worker groups guide",
+ "Start a worker": "Start a worker",
+ "Unlock worker groups": "Unlock worker groups",
+ "Set aside servers for specific projects or flows, so a busy project never slows down the rest.": "Set aside servers for specific projects or flows, so a busy project never slows down the rest.",
+ "Add projects": "Add projects",
+ "Add flows": "Add flows",
+ "Add {count, plural, =1 {1 project} other {# projects}}": "Add {count, plural, =1 {1 project} other {# projects}}",
+ "Add {count, plural, =1 {1 flow} other {# flows}}": "Add {count, plural, =1 {1 flow} other {# flows}}",
+ "Add projects to {group}": "Add projects to {group}",
+ "Add flows to {group}": "Add flows to {group}",
+ "The projects you pick, and their flows, will run on this group.": "The projects you pick, and their flows, will run on this group.",
+ "The flows you pick will run on this group instead of their project’s group.": "The flows you pick will run on this group instead of their project’s group.",
+ "Now on {group}": "Now on {group}",
+ "Nothing matches your search.": "Nothing matches your search.",
+ "Nothing to add.": "Nothing to add.",
+ "This group has no workers online. Runs will wait until a worker is back.": "This group has no workers online. Runs will wait until a worker is back.",
+ "first {shown} of {total} shown, search to find others": "first {shown} of {total} shown, search to find others",
+ "Find a project": "Find a project",
+ "No projects match your search.": "No projects match your search.",
+ "Flow groups": "Flow groups",
+ "Project groups": "Project groups",
+ "Only the flows picked here run on these servers. Their projects stay where they are.": "Only the flows picked here run on these servers. Their projects stay where they are.",
+ "Each project here runs with all its flows, unless a flow has its own group.": "Each project here runs with all its flows, unless a flow has its own group.",
+ "{count, plural, =1 {1 flow} other {{countText} flows}}": "{count, plural, =1 {1 flow} other {{countText} flows}}",
+ "{count, plural, =1 {1 project} other {{countText} projects}}": "{count, plural, =1 {1 project} other {{countText} projects}}",
+ "View projects": "View projects",
+ "not in a group": "not in a group",
+ "{count, plural, =1 {1 run waiting} other {# runs waiting}}": "{count, plural, =1 {1 run waiting} other {# runs waiting}}",
+ "{count, plural, =1 {1 worker online} other {# workers online}}": "{count, plural, =1 {1 worker online} other {# workers online}}",
+ "No workers online": "No workers online",
+ "Not in use": "Not in use",
+ "Concurrency {count, number}": "Concurrency {count, number}",
+ "No runs waiting": "No runs waiting",
+ "No workers use this name": "No workers use this name",
+ "Nothing yet": "Nothing yet",
+ "+{count, number} more": "+{count, number} more",
+ "Open": "Open",
+ "Open {group}": "Open {group}",
+ "All groups": "All groups",
+ "Group not found": "Group not found",
+ "No worker group called {name} exists on this platform. It may have been renamed, or its workers stopped.": "No worker group called {name} exists on this platform. It may have been renamed, or its workers stopped.",
+ "Back to all groups": "Back to all groups",
+ "Projects that are not in a group run here, with their flows.": "Projects that are not in a group run here, with their flows.",
+ "Only the flows listed here run on this group. Their projects stay where they are.": "Only the flows listed here run on this group. Their projects stay where they are.",
+ "The projects listed here run on this group, with all their flows, unless a flow has its own group.": "The projects listed here run on this group, with all their flows, unless a flow has its own group.",
+ "Workers join this group with": "Workers join this group with",
+ "Move all to…": "Move all to…",
+ "Runs sent here wait until a worker is back. Move its flows to another group to keep them running.": "Runs sent here wait until a worker is back. Move its flows to another group to keep them running.",
+ "Runs sent here wait until a worker is back. Move its projects to another group to keep them running.": "Runs sent here wait until a worker is back. Move its projects to another group to keep them running.",
+ "No flows run on this group yet. Use Add flows to pick some.": "No flows run on this group yet. Use Add flows to pick some.",
+ "Every project is in a group.": "Every project is in a group.",
+ "No projects run on this group yet. Use Add projects to pick some.": "No projects run on this group yet. Use Add projects to pick some.",
+ "Could not move. Nothing was changed.": "Could not move. Nothing was changed.",
+ "Move undone.": "Move undone.",
+ "Could not undo the move.": "Could not undo the move.",
+ "{project} now uses the default concurrency limit.": "{project} now uses the default concurrency limit.",
+ "{project} now has a concurrency limit of {count, number}.": "{project} now has a concurrency limit of {count, number}.",
+ "Could not save the concurrency limit. Nothing was changed.": "Could not save the concurrency limit. Nothing was changed.",
+ "Shared workers": "Shared workers",
+ "{workers, plural, =1 {1 worker} other {# workers}} · concurrency {slots, number}": "{workers, plural, =1 {1 worker} other {# workers}} · concurrency {slots, number}",
+ "{projects, plural, =1 {1 project} other {{projectsText} projects}} · {flows, plural, =1 {1 flow} other {{flowsText} flows}}": "{projects, plural, =1 {1 project} other {{projectsText} projects}} · {flows, plural, =1 {1 flow} other {{flowsText} flows}}",
+ "{flows, plural, =1 {1 flow} other {{flowsText} flows}}": "{flows, plural, =1 {1 flow} other {{flowsText} flows}}",
+ "Moved {projects, plural, =1 {1 project} other {# projects}} and {flows, plural, =1 {1 flow} other {# flows}} to {group}.": "Moved {projects, plural, =1 {1 project} other {# projects}} and {flows, plural, =1 {1 flow} other {# flows}} to {group}.",
+ "Moved {count, plural, =1 {1 project} other {# projects}} to {group}.": "Moved {count, plural, =1 {1 project} other {# projects}} to {group}.",
+ "Moved {count, plural, =1 {1 flow back to its project group.} other {# flows back to their project groups.}}": "Moved {count, plural, =1 {1 flow back to its project group.} other {# flows back to their project groups.}}",
+ "Moved {count, plural, =1 {1 flow} other {# flows}} to {group}.": "Moved {count, plural, =1 {1 flow} other {# flows}} to {group}.",
+ "{count, plural, =1 {1 waiting run went with them.} other {# waiting runs went with them.}}": "{count, plural, =1 {1 waiting run went with them.} other {# waiting runs went with them.}}",
+ "Back to each flow’s project group": "Back to each flow’s project group",
+ "{count, plural, =1 {1 flow} other {# flows}}": "{count, plural, =1 {1 flow} other {# flows}}",
+ "{projects, plural, =1 {1 project} other {# projects}} ({flows, plural, =1 {1 flow} other {# flows}})": "{projects, plural, =1 {1 project} other {# projects}} ({flows, plural, =1 {1 flow} other {# flows}})",
+ "Move {count, plural, =1 {1 selected flow} other {# selected flows}}": "Move {count, plural, =1 {1 selected flow} other {# selected flows}}",
+ "Move {count, plural, =1 {1 selected project} other {# selected projects}}": "Move {count, plural, =1 {1 selected project} other {# selected projects}}",
+ "Move all from {group}": "Move all from {group}",
+ "{what} will move to the group you pick.": "{what} will move to the group you pick.",
+ "{count, plural, =1 {1 waiting run goes with them.} other {# waiting runs go with them.}}": "{count, plural, =1 {1 waiting run goes with them.} other {# waiting runs go with them.}}",
+ "Find a group": "Find a group",
+ "The group {group} has no workers online. Runs will wait there until a worker is back.": "The group {group} has no workers online. Runs will wait there until a worker is back.",
+ "Same as project ({group})": "Same as project ({group})",
+ "Move {subject} to {group}?": "Move {subject} to {group}?",
+ "{from}–{to} of {total}": "{from}–{to} of {total}",
+ "Previous page": "Previous page",
+ "Next page": "Next page",
+ "All {count, number} selected": "All {count, number} selected",
+ "Move to…": "Move to…",
+ "Select all {count, number}": "Select all {count, number}",
+ "Move {what} back to their project groups?": "Move {what} back to their project groups?",
+ "Move {what} to {group}?": "Move {what} to {group}?",
+ "{count, plural, =1 {1 flow moves with them.} other {# flows move with them.}}": "{count, plural, =1 {1 flow moves with them.} other {# flows move with them.}}",
+ "{count, plural, =1 {1 of the picked items is already on {group}.} other {# of the picked items are already on {group}.}}": "{count, plural, =1 {1 of the picked items is already on {group}.} other {# of the picked items are already on {group}.}}",
+ "You can undo this right after.": "You can undo this right after.",
+ "Worker groups are servers set aside for specific projects or flows. Everything else runs on your shared workers.": "Worker groups are servers set aside for specific projects or flows. Everything else runs on your shared workers.",
+ "No flow groups yet. Flow groups come from workers started for flows.": "No flow groups yet. Flow groups come from workers started for flows.",
+ "No project groups yet. Project groups come from workers started for projects.": "No project groups yet. Project groups come from workers started for projects.",
+ "How to add one": "How to add one",
+ "{count, number}": "{count, number}",
+ "Default ({count, number})": "Default ({count, number})",
+ "How many runs of {project} can go at the same time. Extra runs wait their turn.": "How many runs of {project} can go at the same time. Extra runs wait their turn.",
+ "Enter a whole number above 0.": "Enter a whole number above 0.",
+ "Leave it empty to use the default, {count, number}. The default comes from your plan and the group’s capacity.": "Leave it empty to use the default, {count, number}. The default comes from your plan and the group’s capacity.",
+ "search results": "search results",
+ "Nothing matches {query}.": "Nothing matches {query}.",
+ "{count, plural, =1 {1 result} other {{countText} results}}": "{count, plural, =1 {1 result} other {{countText} results}}",
+ "runs on": "runs on",
+ "in {project} runs on": "in {project} runs on",
+ "(the project’s group)": "(the project’s group)",
+ "You have no worker groups yet": "You have no worker groups yet",
+ "Right now every project and flow runs on your shared workers. That is fine for most teams.": "Right now every project and flow runs on your shared workers. That is fine for most teams.",
+ "When a group helps": "When a group helps",
+ "A busy project slows the others down. Give it its own servers.": "A busy project slows the others down. Give it its own servers.",
+ "A few flows need more memory or a GPU. Send just those flows to bigger servers.": "A few flows need more memory or a GPU. Send just those flows to bigger servers.",
+ "A project must run in one region or network. Keep it on servers there.": "A project must run in one region or network. Keep it on servers there.",
+ "Read the guide": "Read the guide",
+ "Start one or more workers with": "Start one or more workers with",
+ ", using your own group name.": ", using your own group name.",
+ "For a group that runs single flows instead of whole projects, also set": "For a group that runs single flows instead of whole projects, also set",
+ "The group shows up here once a worker is online. Then add projects or flows to it.": "The group shows up here once a worker is online. Then add projects or flows to it.",
+ "Worker group": "Worker group",
+ "No flows match your search.": "No flows match your search.",
+ "Select {name}": "Select {name}",
+ "View flows": "View flows",
+ "Select all on this page": "Select all on this page",
+ "{count, plural, =1 {1 flow runs on {group}} other {# flows run on {group}}}": "{count, plural, =1 {1 flow runs on {group}} other {# flows run on {group}}}",
+ "{count, plural, =1 {1 flow runs on another group} other {# flows run on other groups}}": "{count, plural, =1 {1 flow runs on another group} other {# flows run on other groups}}",
+ "{count, plural, =1 {1 flow} other {# flows}} on {group}, which has no workers online": "{count, plural, =1 {1 flow} other {# flows}} on {group}, which has no workers online",
+ "{count, plural, =1 {1 flow} other {# flows}} on {group}": "{count, plural, =1 {1 flow} other {# flows}} on {group}",
+ "{count, plural, =1 {1 flow moves} other {# flows move}}; {kept, plural, =1 {1 keeps its own group.} other {# keep their own group.}}": "{count, plural, =1 {1 flow moves} other {# flows move}}; {kept, plural, =1 {1 keeps its own group.} other {# keep their own group.}}",
+ "{count, plural, =1 {Its 1 flow moves too.} other {Its # flows move too.}}": "{count, plural, =1 {Its 1 flow moves too.} other {Its # flows move too.}}",
+ "worker groups": "worker groups",
+ "Where does a project or flow run?": "Where does a project or flow run?",
+ "Flows in {project}": "Flows in {project}",
+ "These flows run on {group}, the project’s group, unless you pick another group for a flow.": "These flows run on {group}, the project’s group, unless you pick another group for a flow.",
+ "This project has no flows.": "This project has no flows.",
+ "This group name is not allowed.": "This group name is not allowed.",
+ "2d": "2d",
+ "First {shown, number} of {total, number}. Type to narrow.": "First {shown, number} of {total, number}. Type to narrow.",
+ "Moved {done, number} of {total, number}. The rest could not be moved.": "Moved {done, number} of {total, number}. The rest could not be moved.",
+ "Nothing was left to move.": "Nothing was left to move.",
+ "canvas": "canvas",
+ "cursor": "cursor",
+ "group": "group",
+ "name": "name",
+ "q": "q",
+ "The most runs of one project at the same time. Flows with their own group are not limited by it. Extra runs wait their turn.": "The most runs of one project at the same time. Flows with their own group are not limited by it. Extra runs wait their turn.",
"Set up {client}": "Set up {client}",
"Try asking": "Try asking",
"Used {ago}": "Used {ago}",
diff --git a/packages/web/public/locales/es/translation.json b/packages/web/public/locales/es/translation.json
index ac81302b329..837eb0d1a02 100644
--- a/packages/web/public/locales/es/translation.json
+++ b/packages/web/public/locales/es/translation.json
@@ -1554,28 +1554,13 @@
"No trigger data available": "No hay datos de disparo disponibles",
"Trigger health information will appear here": "La información de salud del activador aparecerá aquí",
"trigger status": "trigger status",
- "in this group": "in this group",
- "currently in {group} — will move here": "currently in {group} — will move here",
- "shared queue": "shared queue",
- "Assign projects": "Assign projects",
"These projects will run on this group's dedicated queue.": "These projects will run on this group's dedicated queue.",
- "No projects": "No projects",
- "{count, plural, =1 {worker} other {workers}}": "{count, plural, =1 {worker} other {workers}}",
- "{count} total concurrencies": "{count} total concurrencies",
- "Assign": "Assign",
"+{count} more": "+{count} más",
- "Allocate capacity per project — pick its worker group and concurrency limit. Leave the limit empty to inherit the platform default. Project settings shows these read-only and links here.": "Allocate capacity per project — pick its worker group and concurrency limit. Leave the limit empty to inherit the platform default. Project settings shows these read-only and links here.",
"projects": "proyectos",
- "No projects yet": "No projects yet",
"Start by creating projects to manage your automation teams": "Empieza creando proyectos para administrar tus equipos de automatización",
- "Assigned worker": "Assigned worker",
"Concurrency limit": "Concurrency limit",
"Saved": "Saved",
- "Failed to save": "Failed to save",
"Shared": "Compartido",
- "{group} has no workers online. Runs will wait in its queue": "{group} has no workers online. Runs will wait in its queue",
- "Default {count}": "Default {count}",
- "Concurrency limit must be a positive number": "Concurrency limit must be a positive number",
"Check the health of your workers": "Compruebe la salud de sus trabajadores",
"Upgrade to Dedicated Workers": "Actualizar a Trabajadores Dedicados",
"Your automations run on shared workers where strict sandboxing adds overhead to every execution. Dedicated workers give you your own execution pool that stays warm and ready, so your automations start much faster.": "Sus automatizaciones se ejecutan en trabajadores compartidos donde el sandboxing estricto añade sobrecarga a cada ejecución. Los trabajadores dedicados le dan su propia piscina de ejecución que permanece cálida y lista, para que sus automatizaciones comiencen mucho más rápido.",
@@ -1583,8 +1568,6 @@
"Your workers run exclusively for your platform. The execution pool stays warm with no sandboxing overhead, so your automations start instantly.": "Sus trabajadores corren exclusivamente para su plataforma. El pool de ejecución permanece caliente sin sobrecarga de sandboxing, por lo que sus automatizaciones comienzan al instante.",
"No workers found": "No se encontraron trabajadores",
"You don't have any workers yet. Spin up new workers to execute your automations": "No tienes ningún trabajador todavía. Pon nuevos trabajadores para ejecutar tus automatizaciones",
- "Unlock Worker Groups": "Unlock Worker Groups",
- "Reserve dedicated worker capacity for specific projects so a busy project never slows down the rest": "Reserve dedicated worker capacity for specific projects so a busy project never slows down the rest",
"Dedicated": "Dedicado",
"This worker runs the projects assigned to the {group} group.": "This worker runs the projects assigned to the {group} group.",
"This worker runs exclusively for your platform with no sandboxing overhead.": "Este trabajador corre exclusivamente para su plataforma sin sobrecarga de sandboxing.",
@@ -1598,9 +1581,6 @@
"Box": "Box",
"Busy": "Ocupado",
"Idle": "Idle",
- "Worker groups reserve a dedicated queue for the projects you assign. Defined in your deployment with AP_WORKER_GROUP_ID.": "Worker groups reserve a dedicated queue for the projects you assign. Defined in your deployment with AP_WORKER_GROUP_ID.",
- "By project": "By project",
- "By group": "By group",
"Configs": "Configurar",
"Variable": "Variable",
"Created": "Creado",
@@ -3378,5 +3358,148 @@
"People can no longer sign in with email and password.": "People can no longer sign in with email and password.",
"Couldn't disable single sign-on": "Couldn't disable single sign-on",
"Couldn't save single sign-on settings": "Couldn't save single sign-on settings",
- "To change the connection, paste both values again.": "To change the connection, paste both values again."
-}
\ No newline at end of file
+ "To change the connection, paste both values again.": "To change the connection, paste both values again.",
+ "Worker groups guide": "",
+ "Start a worker": "",
+ "Unlock worker groups": "",
+ "Set aside servers for specific projects or flows, so a busy project never slows down the rest.": "",
+ "Add projects": "",
+ "Add flows": "",
+ "Add {count, plural, =1 {1 project} other {# projects}}": "",
+ "Add {count, plural, =1 {1 flow} other {# flows}}": "",
+ "Add projects to {group}": "",
+ "Add flows to {group}": "",
+ "The projects you pick, and their flows, will run on this group.": "",
+ "The flows you pick will run on this group instead of their project’s group.": "",
+ "Now on {group}": "",
+ "Nothing matches your search.": "",
+ "Nothing to add.": "",
+ "This group has no workers online. Runs will wait until a worker is back.": "",
+ "first {shown} of {total} shown, search to find others": "",
+ "Find a project": "",
+ "No projects match your search.": "",
+ "Flow groups": "",
+ "Project groups": "",
+ "Only the flows picked here run on these servers. Their projects stay where they are.": "",
+ "Each project here runs with all its flows, unless a flow has its own group.": "",
+ "{count, plural, =1 {1 flow} other {{countText} flows}}": "",
+ "{count, plural, =1 {1 project} other {{countText} projects}}": "",
+ "View projects": "",
+ "not in a group": "",
+ "{count, plural, =1 {1 run waiting} other {# runs waiting}}": "",
+ "{count, plural, =1 {1 worker online} other {# workers online}}": "",
+ "No workers online": "",
+ "Not in use": "",
+ "Concurrency {count, number}": "",
+ "No runs waiting": "",
+ "No workers use this name": "",
+ "Nothing yet": "",
+ "+{count, number} more": "",
+ "Open": "",
+ "Open {group}": "",
+ "All groups": "",
+ "Group not found": "",
+ "No worker group called {name} exists on this platform. It may have been renamed, or its workers stopped.": "",
+ "Back to all groups": "",
+ "Projects that are not in a group run here, with their flows.": "",
+ "Only the flows listed here run on this group. Their projects stay where they are.": "",
+ "The projects listed here run on this group, with all their flows, unless a flow has its own group.": "",
+ "Workers join this group with": "",
+ "Move all to…": "",
+ "Runs sent here wait until a worker is back. Move its flows to another group to keep them running.": "",
+ "Runs sent here wait until a worker is back. Move its projects to another group to keep them running.": "",
+ "No flows run on this group yet. Use Add flows to pick some.": "",
+ "Every project is in a group.": "",
+ "No projects run on this group yet. Use Add projects to pick some.": "",
+ "Could not move. Nothing was changed.": "",
+ "Move undone.": "",
+ "Could not undo the move.": "",
+ "{project} now uses the default concurrency limit.": "",
+ "{project} now has a concurrency limit of {count, number}.": "",
+ "Could not save the concurrency limit. Nothing was changed.": "",
+ "Shared workers": "",
+ "{workers, plural, =1 {1 worker} other {# workers}} · concurrency {slots, number}": "",
+ "{projects, plural, =1 {1 project} other {{projectsText} projects}} · {flows, plural, =1 {1 flow} other {{flowsText} flows}}": "",
+ "{flows, plural, =1 {1 flow} other {{flowsText} flows}}": "",
+ "Moved {projects, plural, =1 {1 project} other {# projects}} and {flows, plural, =1 {1 flow} other {# flows}} to {group}.": "",
+ "Moved {count, plural, =1 {1 project} other {# projects}} to {group}.": "",
+ "Moved {count, plural, =1 {1 flow back to its project group.} other {# flows back to their project groups.}}": "",
+ "Moved {count, plural, =1 {1 flow} other {# flows}} to {group}.": "",
+ "{count, plural, =1 {1 waiting run went with them.} other {# waiting runs went with them.}}": "",
+ "Back to each flow’s project group": "",
+ "{count, plural, =1 {1 flow} other {# flows}}": "",
+ "{projects, plural, =1 {1 project} other {# projects}} ({flows, plural, =1 {1 flow} other {# flows}})": "",
+ "Move {count, plural, =1 {1 selected flow} other {# selected flows}}": "",
+ "Move {count, plural, =1 {1 selected project} other {# selected projects}}": "",
+ "Move all from {group}": "",
+ "{what} will move to the group you pick.": "",
+ "{count, plural, =1 {1 waiting run goes with them.} other {# waiting runs go with them.}}": "",
+ "Find a group": "",
+ "The group {group} has no workers online. Runs will wait there until a worker is back.": "",
+ "Same as project ({group})": "",
+ "Move {subject} to {group}?": "",
+ "{from}–{to} of {total}": "",
+ "Previous page": "",
+ "Next page": "",
+ "All {count, number} selected": "",
+ "Move to…": "",
+ "Select all {count, number}": "",
+ "Move {what} back to their project groups?": "",
+ "Move {what} to {group}?": "",
+ "{count, plural, =1 {1 flow moves with them.} other {# flows move with them.}}": "",
+ "{count, plural, =1 {1 of the picked items is already on {group}.} other {# of the picked items are already on {group}.}}": "",
+ "You can undo this right after.": "",
+ "Worker groups are servers set aside for specific projects or flows. Everything else runs on your shared workers.": "",
+ "No flow groups yet. Flow groups come from workers started for flows.": "",
+ "No project groups yet. Project groups come from workers started for projects.": "",
+ "How to add one": "",
+ "{count, number}": "",
+ "Default ({count, number})": "",
+ "How many runs of {project} can go at the same time. Extra runs wait their turn.": "",
+ "Enter a whole number above 0.": "",
+ "Leave it empty to use the default, {count, number}. The default comes from your plan and the group’s capacity.": "",
+ "search results": "",
+ "Nothing matches {query}.": "",
+ "{count, plural, =1 {1 result} other {{countText} results}}": "",
+ "runs on": "",
+ "in {project} runs on": "",
+ "(the project’s group)": "",
+ "You have no worker groups yet": "",
+ "Right now every project and flow runs on your shared workers. That is fine for most teams.": "",
+ "When a group helps": "",
+ "A busy project slows the others down. Give it its own servers.": "",
+ "A few flows need more memory or a GPU. Send just those flows to bigger servers.": "",
+ "A project must run in one region or network. Keep it on servers there.": "",
+ "Read the guide": "",
+ "Start one or more workers with": "",
+ ", using your own group name.": "",
+ "For a group that runs single flows instead of whole projects, also set": "",
+ "The group shows up here once a worker is online. Then add projects or flows to it.": "",
+ "Worker group": "",
+ "No flows match your search.": "",
+ "Select {name}": "",
+ "View flows": "",
+ "Select all on this page": "",
+ "{count, plural, =1 {1 flow runs on {group}} other {# flows run on {group}}}": "",
+ "{count, plural, =1 {1 flow runs on another group} other {# flows run on other groups}}": "",
+ "{count, plural, =1 {1 flow} other {# flows}} on {group}, which has no workers online": "",
+ "{count, plural, =1 {1 flow} other {# flows}} on {group}": "",
+ "{count, plural, =1 {1 flow moves} other {# flows move}}; {kept, plural, =1 {1 keeps its own group.} other {# keep their own group.}}": "",
+ "{count, plural, =1 {Its 1 flow moves too.} other {Its # flows move too.}}": "",
+ "worker groups": "",
+ "Where does a project or flow run?": "",
+ "Flows in {project}": "",
+ "These flows run on {group}, the project’s group, unless you pick another group for a flow.": "",
+ "This project has no flows.": "",
+ "This group name is not allowed.": "",
+ "2d": "",
+ "First {shown, number} of {total, number}. Type to narrow.": "",
+ "Moved {done, number} of {total, number}. The rest could not be moved.": "",
+ "Nothing was left to move.": "",
+ "canvas": "",
+ "cursor": "",
+ "group": "",
+ "name": "",
+ "q": "",
+ "The most runs of one project at the same time. Flows with their own group are not limited by it. Extra runs wait their turn.": ""
+}
diff --git a/packages/web/public/locales/fr/translation.json b/packages/web/public/locales/fr/translation.json
index c0cdc62c149..84040e5c7d4 100644
--- a/packages/web/public/locales/fr/translation.json
+++ b/packages/web/public/locales/fr/translation.json
@@ -1554,28 +1554,13 @@
"No trigger data available": "Aucune donnée de déclencheur disponible",
"Trigger health information will appear here": "Les informations sur la santé du déclencheur apparaîtront ici",
"trigger status": "trigger status",
- "in this group": "in this group",
- "currently in {group} — will move here": "currently in {group} — will move here",
- "shared queue": "shared queue",
- "Assign projects": "Assign projects",
"These projects will run on this group's dedicated queue.": "These projects will run on this group's dedicated queue.",
- "No projects": "No projects",
- "{count, plural, =1 {worker} other {workers}}": "{count, plural, =1 {worker} other {workers}}",
- "{count} total concurrencies": "{count} total concurrencies",
- "Assign": "Assign",
"+{count} more": "+{count} de plus",
- "Allocate capacity per project — pick its worker group and concurrency limit. Leave the limit empty to inherit the platform default. Project settings shows these read-only and links here.": "Allocate capacity per project — pick its worker group and concurrency limit. Leave the limit empty to inherit the platform default. Project settings shows these read-only and links here.",
"projects": "projets",
- "No projects yet": "No projects yet",
"Start by creating projects to manage your automation teams": "Commencez par créer des projets pour gérer vos équipes d'automatisation",
- "Assigned worker": "Assigned worker",
"Concurrency limit": "Concurrency limit",
"Saved": "Enregistré",
- "Failed to save": "Failed to save",
"Shared": "Partagé",
- "{group} has no workers online. Runs will wait in its queue": "{group} has no workers online. Runs will wait in its queue",
- "Default {count}": "Default {count}",
- "Concurrency limit must be a positive number": "Concurrency limit must be a positive number",
"Check the health of your workers": "Vérifiez la santé de vos employés",
"Upgrade to Dedicated Workers": "Mettre à niveau vers des employés dédiés",
"Your automations run on shared workers where strict sandboxing adds overhead to every execution. Dedicated workers give you your own execution pool that stays warm and ready, so your automations start much faster.": "Vos automatisations fonctionnent sur des employés partagés où la boxe à sable stricte ajoute des frais à chaque exécution. Des employés dévoués vous donnent votre propre bassin d'exécution qui reste chaud et prêt, afin que vos automatisations commencent beaucoup plus rapidement.",
@@ -1583,8 +1568,6 @@
"Your workers run exclusively for your platform. The execution pool stays warm with no sandboxing overhead, so your automations start instantly.": "Vos employés fonctionnent exclusivement pour votre plateforme. Le bassin d'exécution reste chaud sans surface, donc vos automatisations commencent instantanément.",
"No workers found": "Aucun travailleur trouvé",
"You don't have any workers yet. Spin up new workers to execute your automations": "Vous n'avez pas encore de collaborateurs-trices pour exécuter vos automatisations.",
- "Unlock Worker Groups": "Unlock Worker Groups",
- "Reserve dedicated worker capacity for specific projects so a busy project never slows down the rest": "Reserve dedicated worker capacity for specific projects so a busy project never slows down the rest",
"Dedicated": "Dédié",
"This worker runs the projects assigned to the {group} group.": "This worker runs the projects assigned to the {group} group.",
"This worker runs exclusively for your platform with no sandboxing overhead.": "Ce travailleur fonctionne exclusivement pour votre plate-forme sans tête de bac à sable.",
@@ -1598,9 +1581,6 @@
"Box": "Boîte",
"Busy": "Occupé",
"Idle": "Idle",
- "Worker groups reserve a dedicated queue for the projects you assign. Defined in your deployment with AP_WORKER_GROUP_ID.": "Worker groups reserve a dedicated queue for the projects you assign. Defined in your deployment with AP_WORKER_GROUP_ID.",
- "By project": "By project",
- "By group": "By group",
"Configs": "Configurations",
"Variable": "Variable",
"Created": "Créé",
@@ -3378,5 +3358,148 @@
"People can no longer sign in with email and password.": "People can no longer sign in with email and password.",
"Couldn't disable single sign-on": "Couldn't disable single sign-on",
"Couldn't save single sign-on settings": "Couldn't save single sign-on settings",
- "To change the connection, paste both values again.": "To change the connection, paste both values again."
-}
\ No newline at end of file
+ "To change the connection, paste both values again.": "To change the connection, paste both values again.",
+ "Worker groups guide": "",
+ "Start a worker": "",
+ "Unlock worker groups": "",
+ "Set aside servers for specific projects or flows, so a busy project never slows down the rest.": "",
+ "Add projects": "",
+ "Add flows": "",
+ "Add {count, plural, =1 {1 project} other {# projects}}": "",
+ "Add {count, plural, =1 {1 flow} other {# flows}}": "",
+ "Add projects to {group}": "",
+ "Add flows to {group}": "",
+ "The projects you pick, and their flows, will run on this group.": "",
+ "The flows you pick will run on this group instead of their project’s group.": "",
+ "Now on {group}": "",
+ "Nothing matches your search.": "",
+ "Nothing to add.": "",
+ "This group has no workers online. Runs will wait until a worker is back.": "",
+ "first {shown} of {total} shown, search to find others": "",
+ "Find a project": "",
+ "No projects match your search.": "",
+ "Flow groups": "",
+ "Project groups": "",
+ "Only the flows picked here run on these servers. Their projects stay where they are.": "",
+ "Each project here runs with all its flows, unless a flow has its own group.": "",
+ "{count, plural, =1 {1 flow} other {{countText} flows}}": "",
+ "{count, plural, =1 {1 project} other {{countText} projects}}": "",
+ "View projects": "",
+ "not in a group": "",
+ "{count, plural, =1 {1 run waiting} other {# runs waiting}}": "",
+ "{count, plural, =1 {1 worker online} other {# workers online}}": "",
+ "No workers online": "",
+ "Not in use": "",
+ "Concurrency {count, number}": "",
+ "No runs waiting": "",
+ "No workers use this name": "",
+ "Nothing yet": "",
+ "+{count, number} more": "",
+ "Open": "",
+ "Open {group}": "",
+ "All groups": "",
+ "Group not found": "",
+ "No worker group called {name} exists on this platform. It may have been renamed, or its workers stopped.": "",
+ "Back to all groups": "",
+ "Projects that are not in a group run here, with their flows.": "",
+ "Only the flows listed here run on this group. Their projects stay where they are.": "",
+ "The projects listed here run on this group, with all their flows, unless a flow has its own group.": "",
+ "Workers join this group with": "",
+ "Move all to…": "",
+ "Runs sent here wait until a worker is back. Move its flows to another group to keep them running.": "",
+ "Runs sent here wait until a worker is back. Move its projects to another group to keep them running.": "",
+ "No flows run on this group yet. Use Add flows to pick some.": "",
+ "Every project is in a group.": "",
+ "No projects run on this group yet. Use Add projects to pick some.": "",
+ "Could not move. Nothing was changed.": "",
+ "Move undone.": "",
+ "Could not undo the move.": "",
+ "{project} now uses the default concurrency limit.": "",
+ "{project} now has a concurrency limit of {count, number}.": "",
+ "Could not save the concurrency limit. Nothing was changed.": "",
+ "Shared workers": "",
+ "{workers, plural, =1 {1 worker} other {# workers}} · concurrency {slots, number}": "",
+ "{projects, plural, =1 {1 project} other {{projectsText} projects}} · {flows, plural, =1 {1 flow} other {{flowsText} flows}}": "",
+ "{flows, plural, =1 {1 flow} other {{flowsText} flows}}": "",
+ "Moved {projects, plural, =1 {1 project} other {# projects}} and {flows, plural, =1 {1 flow} other {# flows}} to {group}.": "",
+ "Moved {count, plural, =1 {1 project} other {# projects}} to {group}.": "",
+ "Moved {count, plural, =1 {1 flow back to its project group.} other {# flows back to their project groups.}}": "",
+ "Moved {count, plural, =1 {1 flow} other {# flows}} to {group}.": "",
+ "{count, plural, =1 {1 waiting run went with them.} other {# waiting runs went with them.}}": "",
+ "Back to each flow’s project group": "",
+ "{count, plural, =1 {1 flow} other {# flows}}": "",
+ "{projects, plural, =1 {1 project} other {# projects}} ({flows, plural, =1 {1 flow} other {# flows}})": "",
+ "Move {count, plural, =1 {1 selected flow} other {# selected flows}}": "",
+ "Move {count, plural, =1 {1 selected project} other {# selected projects}}": "",
+ "Move all from {group}": "",
+ "{what} will move to the group you pick.": "",
+ "{count, plural, =1 {1 waiting run goes with them.} other {# waiting runs go with them.}}": "",
+ "Find a group": "",
+ "The group {group} has no workers online. Runs will wait there until a worker is back.": "",
+ "Same as project ({group})": "",
+ "Move {subject} to {group}?": "",
+ "{from}–{to} of {total}": "",
+ "Previous page": "",
+ "Next page": "",
+ "All {count, number} selected": "",
+ "Move to…": "",
+ "Select all {count, number}": "",
+ "Move {what} back to their project groups?": "",
+ "Move {what} to {group}?": "",
+ "{count, plural, =1 {1 flow moves with them.} other {# flows move with them.}}": "",
+ "{count, plural, =1 {1 of the picked items is already on {group}.} other {# of the picked items are already on {group}.}}": "",
+ "You can undo this right after.": "",
+ "Worker groups are servers set aside for specific projects or flows. Everything else runs on your shared workers.": "",
+ "No flow groups yet. Flow groups come from workers started for flows.": "",
+ "No project groups yet. Project groups come from workers started for projects.": "",
+ "How to add one": "",
+ "{count, number}": "",
+ "Default ({count, number})": "",
+ "How many runs of {project} can go at the same time. Extra runs wait their turn.": "",
+ "Enter a whole number above 0.": "",
+ "Leave it empty to use the default, {count, number}. The default comes from your plan and the group’s capacity.": "",
+ "search results": "",
+ "Nothing matches {query}.": "",
+ "{count, plural, =1 {1 result} other {{countText} results}}": "",
+ "runs on": "",
+ "in {project} runs on": "",
+ "(the project’s group)": "",
+ "You have no worker groups yet": "",
+ "Right now every project and flow runs on your shared workers. That is fine for most teams.": "",
+ "When a group helps": "",
+ "A busy project slows the others down. Give it its own servers.": "",
+ "A few flows need more memory or a GPU. Send just those flows to bigger servers.": "",
+ "A project must run in one region or network. Keep it on servers there.": "",
+ "Read the guide": "",
+ "Start one or more workers with": "",
+ ", using your own group name.": "",
+ "For a group that runs single flows instead of whole projects, also set": "",
+ "The group shows up here once a worker is online. Then add projects or flows to it.": "",
+ "Worker group": "",
+ "No flows match your search.": "",
+ "Select {name}": "",
+ "View flows": "",
+ "Select all on this page": "",
+ "{count, plural, =1 {1 flow runs on {group}} other {# flows run on {group}}}": "",
+ "{count, plural, =1 {1 flow runs on another group} other {# flows run on other groups}}": "",
+ "{count, plural, =1 {1 flow} other {# flows}} on {group}, which has no workers online": "",
+ "{count, plural, =1 {1 flow} other {# flows}} on {group}": "",
+ "{count, plural, =1 {1 flow moves} other {# flows move}}; {kept, plural, =1 {1 keeps its own group.} other {# keep their own group.}}": "",
+ "{count, plural, =1 {Its 1 flow moves too.} other {Its # flows move too.}}": "",
+ "worker groups": "",
+ "Where does a project or flow run?": "",
+ "Flows in {project}": "",
+ "These flows run on {group}, the project’s group, unless you pick another group for a flow.": "",
+ "This project has no flows.": "",
+ "This group name is not allowed.": "",
+ "2d": "",
+ "First {shown, number} of {total, number}. Type to narrow.": "",
+ "Moved {done, number} of {total, number}. The rest could not be moved.": "",
+ "Nothing was left to move.": "",
+ "canvas": "",
+ "cursor": "",
+ "group": "",
+ "name": "",
+ "q": "",
+ "The most runs of one project at the same time. Flows with their own group are not limited by it. Extra runs wait their turn.": ""
+}
diff --git a/packages/web/public/locales/ja/translation.json b/packages/web/public/locales/ja/translation.json
index 713db75fc13..a5966067d48 100644
--- a/packages/web/public/locales/ja/translation.json
+++ b/packages/web/public/locales/ja/translation.json
@@ -1554,28 +1554,13 @@
"No trigger data available": "利用可能なトリガーデータがありません",
"Trigger health information will appear here": "トリガーの健康情報がここに表示されます",
"trigger status": "trigger status",
- "in this group": "in this group",
- "currently in {group} — will move here": "currently in {group} — will move here",
- "shared queue": "shared queue",
- "Assign projects": "Assign projects",
"These projects will run on this group's dedicated queue.": "These projects will run on this group's dedicated queue.",
- "No projects": "No projects",
- "{count, plural, =1 {worker} other {workers}}": "{count, plural, =1 {worker} other {workers}}",
- "{count} total concurrencies": "{count} total concurrencies",
- "Assign": "Assign",
"+{count} more": "+{count}以上",
- "Allocate capacity per project — pick its worker group and concurrency limit. Leave the limit empty to inherit the platform default. Project settings shows these read-only and links here.": "Allocate capacity per project — pick its worker group and concurrency limit. Leave the limit empty to inherit the platform default. Project settings shows these read-only and links here.",
"projects": "projects",
- "No projects yet": "No projects yet",
"Start by creating projects to manage your automation teams": "オートメーションチームを管理するプロジェクトを作成することから始めましょう",
- "Assigned worker": "Assigned worker",
"Concurrency limit": "Concurrency limit",
"Saved": "Saved",
- "Failed to save": "Failed to save",
"Shared": "共有",
- "{group} has no workers online. Runs will wait in its queue": "{group} has no workers online. Runs will wait in its queue",
- "Default {count}": "Default {count}",
- "Concurrency limit must be a positive number": "Concurrency limit must be a positive number",
"Check the health of your workers": "労働者の健康状態を確認する",
"Upgrade to Dedicated Workers": "Dedicated Worker にアップグレード",
"Your automations run on shared workers where strict sandboxing adds overhead to every execution. Dedicated workers give you your own execution pool that stays warm and ready, so your automations start much faster.": "自動化は共有ワーカー上で実行され、厳密なサンドボックス化によってすべての実行にオーバーヘッドが加わります。 専用のワーカーは、暖かく準備ができているあなた自身の実行プールを与えるので、自動化がはるかに速く始まります。",
@@ -1583,8 +1568,6 @@
"Your workers run exclusively for your platform. The execution pool stays warm with no sandboxing overhead, so your automations start instantly.": "ワーカーはプラットフォームに対してのみ実行されます。実行プールはサンドボックスのオーバーヘッドなしで暖かく保たれるため、オートメーションは即座に開始されます。",
"No workers found": "ワーカーが見つかりません",
"You don't have any workers yet. Spin up new workers to execute your automations": "あなたはまだワーカーを持っていません。自動化を実行するための新しいワーカーをスピンアップしてください",
- "Unlock Worker Groups": "Unlock Worker Groups",
- "Reserve dedicated worker capacity for specific projects so a busy project never slows down the rest": "Reserve dedicated worker capacity for specific projects so a busy project never slows down the rest",
"Dedicated": "専用の",
"This worker runs the projects assigned to the {group} group.": "This worker runs the projects assigned to the {group} group.",
"This worker runs exclusively for your platform with no sandboxing overhead.": "このワーカーは、サンドボックス化オーバーヘッドのないプラットフォーム向けにのみ動作します。",
@@ -1598,9 +1581,6 @@
"Box": "Box",
"Busy": "取り込み中",
"Idle": "Idle",
- "Worker groups reserve a dedicated queue for the projects you assign. Defined in your deployment with AP_WORKER_GROUP_ID.": "Worker groups reserve a dedicated queue for the projects you assign. Defined in your deployment with AP_WORKER_GROUP_ID.",
- "By project": "By project",
- "By group": "By group",
"Configs": "構成",
"Variable": "変数",
"Created": "作成済み",
@@ -3378,5 +3358,148 @@
"People can no longer sign in with email and password.": "People can no longer sign in with email and password.",
"Couldn't disable single sign-on": "Couldn't disable single sign-on",
"Couldn't save single sign-on settings": "Couldn't save single sign-on settings",
- "To change the connection, paste both values again.": "To change the connection, paste both values again."
-}
\ No newline at end of file
+ "To change the connection, paste both values again.": "To change the connection, paste both values again.",
+ "Worker groups guide": "",
+ "Start a worker": "",
+ "Unlock worker groups": "",
+ "Set aside servers for specific projects or flows, so a busy project never slows down the rest.": "",
+ "Add projects": "",
+ "Add flows": "",
+ "Add {count, plural, =1 {1 project} other {# projects}}": "",
+ "Add {count, plural, =1 {1 flow} other {# flows}}": "",
+ "Add projects to {group}": "",
+ "Add flows to {group}": "",
+ "The projects you pick, and their flows, will run on this group.": "",
+ "The flows you pick will run on this group instead of their project’s group.": "",
+ "Now on {group}": "",
+ "Nothing matches your search.": "",
+ "Nothing to add.": "",
+ "This group has no workers online. Runs will wait until a worker is back.": "",
+ "first {shown} of {total} shown, search to find others": "",
+ "Find a project": "",
+ "No projects match your search.": "",
+ "Flow groups": "",
+ "Project groups": "",
+ "Only the flows picked here run on these servers. Their projects stay where they are.": "",
+ "Each project here runs with all its flows, unless a flow has its own group.": "",
+ "{count, plural, =1 {1 flow} other {{countText} flows}}": "",
+ "{count, plural, =1 {1 project} other {{countText} projects}}": "",
+ "View projects": "",
+ "not in a group": "",
+ "{count, plural, =1 {1 run waiting} other {# runs waiting}}": "",
+ "{count, plural, =1 {1 worker online} other {# workers online}}": "",
+ "No workers online": "",
+ "Not in use": "",
+ "Concurrency {count, number}": "",
+ "No runs waiting": "",
+ "No workers use this name": "",
+ "Nothing yet": "",
+ "+{count, number} more": "",
+ "Open": "",
+ "Open {group}": "",
+ "All groups": "",
+ "Group not found": "",
+ "No worker group called {name} exists on this platform. It may have been renamed, or its workers stopped.": "",
+ "Back to all groups": "",
+ "Projects that are not in a group run here, with their flows.": "",
+ "Only the flows listed here run on this group. Their projects stay where they are.": "",
+ "The projects listed here run on this group, with all their flows, unless a flow has its own group.": "",
+ "Workers join this group with": "",
+ "Move all to…": "",
+ "Runs sent here wait until a worker is back. Move its flows to another group to keep them running.": "",
+ "Runs sent here wait until a worker is back. Move its projects to another group to keep them running.": "",
+ "No flows run on this group yet. Use Add flows to pick some.": "",
+ "Every project is in a group.": "",
+ "No projects run on this group yet. Use Add projects to pick some.": "",
+ "Could not move. Nothing was changed.": "",
+ "Move undone.": "",
+ "Could not undo the move.": "",
+ "{project} now uses the default concurrency limit.": "",
+ "{project} now has a concurrency limit of {count, number}.": "",
+ "Could not save the concurrency limit. Nothing was changed.": "",
+ "Shared workers": "",
+ "{workers, plural, =1 {1 worker} other {# workers}} · concurrency {slots, number}": "",
+ "{projects, plural, =1 {1 project} other {{projectsText} projects}} · {flows, plural, =1 {1 flow} other {{flowsText} flows}}": "",
+ "{flows, plural, =1 {1 flow} other {{flowsText} flows}}": "",
+ "Moved {projects, plural, =1 {1 project} other {# projects}} and {flows, plural, =1 {1 flow} other {# flows}} to {group}.": "",
+ "Moved {count, plural, =1 {1 project} other {# projects}} to {group}.": "",
+ "Moved {count, plural, =1 {1 flow back to its project group.} other {# flows back to their project groups.}}": "",
+ "Moved {count, plural, =1 {1 flow} other {# flows}} to {group}.": "",
+ "{count, plural, =1 {1 waiting run went with them.} other {# waiting runs went with them.}}": "",
+ "Back to each flow’s project group": "",
+ "{count, plural, =1 {1 flow} other {# flows}}": "",
+ "{projects, plural, =1 {1 project} other {# projects}} ({flows, plural, =1 {1 flow} other {# flows}})": "",
+ "Move {count, plural, =1 {1 selected flow} other {# selected flows}}": "",
+ "Move {count, plural, =1 {1 selected project} other {# selected projects}}": "",
+ "Move all from {group}": "",
+ "{what} will move to the group you pick.": "",
+ "{count, plural, =1 {1 waiting run goes with them.} other {# waiting runs go with them.}}": "",
+ "Find a group": "",
+ "The group {group} has no workers online. Runs will wait there until a worker is back.": "",
+ "Same as project ({group})": "",
+ "Move {subject} to {group}?": "",
+ "{from}–{to} of {total}": "",
+ "Previous page": "",
+ "Next page": "",
+ "All {count, number} selected": "",
+ "Move to…": "",
+ "Select all {count, number}": "",
+ "Move {what} back to their project groups?": "",
+ "Move {what} to {group}?": "",
+ "{count, plural, =1 {1 flow moves with them.} other {# flows move with them.}}": "",
+ "{count, plural, =1 {1 of the picked items is already on {group}.} other {# of the picked items are already on {group}.}}": "",
+ "You can undo this right after.": "",
+ "Worker groups are servers set aside for specific projects or flows. Everything else runs on your shared workers.": "",
+ "No flow groups yet. Flow groups come from workers started for flows.": "",
+ "No project groups yet. Project groups come from workers started for projects.": "",
+ "How to add one": "",
+ "{count, number}": "",
+ "Default ({count, number})": "",
+ "How many runs of {project} can go at the same time. Extra runs wait their turn.": "",
+ "Enter a whole number above 0.": "",
+ "Leave it empty to use the default, {count, number}. The default comes from your plan and the group’s capacity.": "",
+ "search results": "",
+ "Nothing matches {query}.": "",
+ "{count, plural, =1 {1 result} other {{countText} results}}": "",
+ "runs on": "",
+ "in {project} runs on": "",
+ "(the project’s group)": "",
+ "You have no worker groups yet": "",
+ "Right now every project and flow runs on your shared workers. That is fine for most teams.": "",
+ "When a group helps": "",
+ "A busy project slows the others down. Give it its own servers.": "",
+ "A few flows need more memory or a GPU. Send just those flows to bigger servers.": "",
+ "A project must run in one region or network. Keep it on servers there.": "",
+ "Read the guide": "",
+ "Start one or more workers with": "",
+ ", using your own group name.": "",
+ "For a group that runs single flows instead of whole projects, also set": "",
+ "The group shows up here once a worker is online. Then add projects or flows to it.": "",
+ "Worker group": "",
+ "No flows match your search.": "",
+ "Select {name}": "",
+ "View flows": "",
+ "Select all on this page": "",
+ "{count, plural, =1 {1 flow runs on {group}} other {# flows run on {group}}}": "",
+ "{count, plural, =1 {1 flow runs on another group} other {# flows run on other groups}}": "",
+ "{count, plural, =1 {1 flow} other {# flows}} on {group}, which has no workers online": "",
+ "{count, plural, =1 {1 flow} other {# flows}} on {group}": "",
+ "{count, plural, =1 {1 flow moves} other {# flows move}}; {kept, plural, =1 {1 keeps its own group.} other {# keep their own group.}}": "",
+ "{count, plural, =1 {Its 1 flow moves too.} other {Its # flows move too.}}": "",
+ "worker groups": "",
+ "Where does a project or flow run?": "",
+ "Flows in {project}": "",
+ "These flows run on {group}, the project’s group, unless you pick another group for a flow.": "",
+ "This project has no flows.": "",
+ "This group name is not allowed.": "",
+ "2d": "",
+ "First {shown, number} of {total, number}. Type to narrow.": "",
+ "Moved {done, number} of {total, number}. The rest could not be moved.": "",
+ "Nothing was left to move.": "",
+ "canvas": "",
+ "cursor": "",
+ "group": "",
+ "name": "",
+ "q": "",
+ "The most runs of one project at the same time. Flows with their own group are not limited by it. Extra runs wait their turn.": ""
+}
diff --git a/packages/web/public/locales/nl/translation.json b/packages/web/public/locales/nl/translation.json
index 0ca18971194..59bf193600a 100644
--- a/packages/web/public/locales/nl/translation.json
+++ b/packages/web/public/locales/nl/translation.json
@@ -1554,28 +1554,13 @@
"No trigger data available": "Geen triggergegevens beschikbaar",
"Trigger health information will appear here": "Trigger gezondheidsinformatie verschijnt hier",
"trigger status": "trigger status",
- "in this group": "in this group",
- "currently in {group} — will move here": "currently in {group} — will move here",
- "shared queue": "shared queue",
- "Assign projects": "Assign projects",
"These projects will run on this group's dedicated queue.": "These projects will run on this group's dedicated queue.",
- "No projects": "No projects",
- "{count, plural, =1 {worker} other {workers}}": "{count, plural, =1 {worker} other {workers}}",
- "{count} total concurrencies": "{count} total concurrencies",
- "Assign": "Assign",
"+{count} more": "{count} meer",
- "Allocate capacity per project — pick its worker group and concurrency limit. Leave the limit empty to inherit the platform default. Project settings shows these read-only and links here.": "Allocate capacity per project — pick its worker group and concurrency limit. Leave the limit empty to inherit the platform default. Project settings shows these read-only and links here.",
"projects": "projecten",
- "No projects yet": "No projects yet",
"Start by creating projects to manage your automation teams": "Begin met het maken van projecten om uw automatiseringsteams te beheren",
- "Assigned worker": "Assigned worker",
"Concurrency limit": "Concurrency limit",
"Saved": "Saved",
- "Failed to save": "Failed to save",
"Shared": "Gedeeld",
- "{group} has no workers online. Runs will wait in its queue": "{group} has no workers online. Runs will wait in its queue",
- "Default {count}": "Default {count}",
- "Concurrency limit must be a positive number": "Concurrency limit must be a positive number",
"Check the health of your workers": "Controleer de gezondheid van uw medewerkers",
"Upgrade to Dedicated Workers": "Upgrade naar toegewijde arbeiders",
"Your automations run on shared workers where strict sandboxing adds overhead to every execution. Dedicated workers give you your own execution pool that stays warm and ready, so your automations start much faster.": "Uw automatiseringen worden uitgevoerd op gedeelde medewerkers, waarbij strikte sandboxing overhead toevoegt aan elke executie. Speciale werknemers geven je eigen executiepoel die warm en klaar blijft, dus je automatiseringen beginnen veel sneller.",
@@ -1583,8 +1568,6 @@
"Your workers run exclusively for your platform. The execution pool stays warm with no sandboxing overhead, so your automations start instantly.": "Je werknemers rennen exclusief op je platform. De executiepool blijft warm zonder sandboxing over je hoofd, dus je automaties beginnen meteen.",
"No workers found": "Geen werknemers gevonden",
"You don't have any workers yet. Spin up new workers to execute your automations": "Je hebt nog geen medewerkers. Maak nieuwe medewerkers beschikbaar om je automatisering uit te voeren",
- "Unlock Worker Groups": "Unlock Worker Groups",
- "Reserve dedicated worker capacity for specific projects so a busy project never slows down the rest": "Reserve dedicated worker capacity for specific projects so a busy project never slows down the rest",
"Dedicated": "Dedicated",
"This worker runs the projects assigned to the {group} group.": "This worker runs the projects assigned to the {group} group.",
"This worker runs exclusively for your platform with no sandboxing overhead.": "Deze werknemer werkt exclusief voor uw platform zonder sandboxing overhead.",
@@ -1598,9 +1581,6 @@
"Box": "Box",
"Busy": "Bezig",
"Idle": "Idle",
- "Worker groups reserve a dedicated queue for the projects you assign. Defined in your deployment with AP_WORKER_GROUP_ID.": "Worker groups reserve a dedicated queue for the projects you assign. Defined in your deployment with AP_WORKER_GROUP_ID.",
- "By project": "By project",
- "By group": "By group",
"Configs": "Configuraties",
"Variable": "Variabele",
"Created": "Aangemaakt",
@@ -3378,5 +3358,148 @@
"People can no longer sign in with email and password.": "People can no longer sign in with email and password.",
"Couldn't disable single sign-on": "Couldn't disable single sign-on",
"Couldn't save single sign-on settings": "Couldn't save single sign-on settings",
- "To change the connection, paste both values again.": "To change the connection, paste both values again."
-}
\ No newline at end of file
+ "To change the connection, paste both values again.": "To change the connection, paste both values again.",
+ "Worker groups guide": "",
+ "Start a worker": "",
+ "Unlock worker groups": "",
+ "Set aside servers for specific projects or flows, so a busy project never slows down the rest.": "",
+ "Add projects": "",
+ "Add flows": "",
+ "Add {count, plural, =1 {1 project} other {# projects}}": "",
+ "Add {count, plural, =1 {1 flow} other {# flows}}": "",
+ "Add projects to {group}": "",
+ "Add flows to {group}": "",
+ "The projects you pick, and their flows, will run on this group.": "",
+ "The flows you pick will run on this group instead of their project’s group.": "",
+ "Now on {group}": "",
+ "Nothing matches your search.": "",
+ "Nothing to add.": "",
+ "This group has no workers online. Runs will wait until a worker is back.": "",
+ "first {shown} of {total} shown, search to find others": "",
+ "Find a project": "",
+ "No projects match your search.": "",
+ "Flow groups": "",
+ "Project groups": "",
+ "Only the flows picked here run on these servers. Their projects stay where they are.": "",
+ "Each project here runs with all its flows, unless a flow has its own group.": "",
+ "{count, plural, =1 {1 flow} other {{countText} flows}}": "",
+ "{count, plural, =1 {1 project} other {{countText} projects}}": "",
+ "View projects": "",
+ "not in a group": "",
+ "{count, plural, =1 {1 run waiting} other {# runs waiting}}": "",
+ "{count, plural, =1 {1 worker online} other {# workers online}}": "",
+ "No workers online": "",
+ "Not in use": "",
+ "Concurrency {count, number}": "",
+ "No runs waiting": "",
+ "No workers use this name": "",
+ "Nothing yet": "",
+ "+{count, number} more": "",
+ "Open": "",
+ "Open {group}": "",
+ "All groups": "",
+ "Group not found": "",
+ "No worker group called {name} exists on this platform. It may have been renamed, or its workers stopped.": "",
+ "Back to all groups": "",
+ "Projects that are not in a group run here, with their flows.": "",
+ "Only the flows listed here run on this group. Their projects stay where they are.": "",
+ "The projects listed here run on this group, with all their flows, unless a flow has its own group.": "",
+ "Workers join this group with": "",
+ "Move all to…": "",
+ "Runs sent here wait until a worker is back. Move its flows to another group to keep them running.": "",
+ "Runs sent here wait until a worker is back. Move its projects to another group to keep them running.": "",
+ "No flows run on this group yet. Use Add flows to pick some.": "",
+ "Every project is in a group.": "",
+ "No projects run on this group yet. Use Add projects to pick some.": "",
+ "Could not move. Nothing was changed.": "",
+ "Move undone.": "",
+ "Could not undo the move.": "",
+ "{project} now uses the default concurrency limit.": "",
+ "{project} now has a concurrency limit of {count, number}.": "",
+ "Could not save the concurrency limit. Nothing was changed.": "",
+ "Shared workers": "",
+ "{workers, plural, =1 {1 worker} other {# workers}} · concurrency {slots, number}": "",
+ "{projects, plural, =1 {1 project} other {{projectsText} projects}} · {flows, plural, =1 {1 flow} other {{flowsText} flows}}": "",
+ "{flows, plural, =1 {1 flow} other {{flowsText} flows}}": "",
+ "Moved {projects, plural, =1 {1 project} other {# projects}} and {flows, plural, =1 {1 flow} other {# flows}} to {group}.": "",
+ "Moved {count, plural, =1 {1 project} other {# projects}} to {group}.": "",
+ "Moved {count, plural, =1 {1 flow back to its project group.} other {# flows back to their project groups.}}": "",
+ "Moved {count, plural, =1 {1 flow} other {# flows}} to {group}.": "",
+ "{count, plural, =1 {1 waiting run went with them.} other {# waiting runs went with them.}}": "",
+ "Back to each flow’s project group": "",
+ "{count, plural, =1 {1 flow} other {# flows}}": "",
+ "{projects, plural, =1 {1 project} other {# projects}} ({flows, plural, =1 {1 flow} other {# flows}})": "",
+ "Move {count, plural, =1 {1 selected flow} other {# selected flows}}": "",
+ "Move {count, plural, =1 {1 selected project} other {# selected projects}}": "",
+ "Move all from {group}": "",
+ "{what} will move to the group you pick.": "",
+ "{count, plural, =1 {1 waiting run goes with them.} other {# waiting runs go with them.}}": "",
+ "Find a group": "",
+ "The group {group} has no workers online. Runs will wait there until a worker is back.": "",
+ "Same as project ({group})": "",
+ "Move {subject} to {group}?": "",
+ "{from}–{to} of {total}": "",
+ "Previous page": "",
+ "Next page": "",
+ "All {count, number} selected": "",
+ "Move to…": "",
+ "Select all {count, number}": "",
+ "Move {what} back to their project groups?": "",
+ "Move {what} to {group}?": "",
+ "{count, plural, =1 {1 flow moves with them.} other {# flows move with them.}}": "",
+ "{count, plural, =1 {1 of the picked items is already on {group}.} other {# of the picked items are already on {group}.}}": "",
+ "You can undo this right after.": "",
+ "Worker groups are servers set aside for specific projects or flows. Everything else runs on your shared workers.": "",
+ "No flow groups yet. Flow groups come from workers started for flows.": "",
+ "No project groups yet. Project groups come from workers started for projects.": "",
+ "How to add one": "",
+ "{count, number}": "",
+ "Default ({count, number})": "",
+ "How many runs of {project} can go at the same time. Extra runs wait their turn.": "",
+ "Enter a whole number above 0.": "",
+ "Leave it empty to use the default, {count, number}. The default comes from your plan and the group’s capacity.": "",
+ "search results": "",
+ "Nothing matches {query}.": "",
+ "{count, plural, =1 {1 result} other {{countText} results}}": "",
+ "runs on": "",
+ "in {project} runs on": "",
+ "(the project’s group)": "",
+ "You have no worker groups yet": "",
+ "Right now every project and flow runs on your shared workers. That is fine for most teams.": "",
+ "When a group helps": "",
+ "A busy project slows the others down. Give it its own servers.": "",
+ "A few flows need more memory or a GPU. Send just those flows to bigger servers.": "",
+ "A project must run in one region or network. Keep it on servers there.": "",
+ "Read the guide": "",
+ "Start one or more workers with": "",
+ ", using your own group name.": "",
+ "For a group that runs single flows instead of whole projects, also set": "",
+ "The group shows up here once a worker is online. Then add projects or flows to it.": "",
+ "Worker group": "",
+ "No flows match your search.": "",
+ "Select {name}": "",
+ "View flows": "",
+ "Select all on this page": "",
+ "{count, plural, =1 {1 flow runs on {group}} other {# flows run on {group}}}": "",
+ "{count, plural, =1 {1 flow runs on another group} other {# flows run on other groups}}": "",
+ "{count, plural, =1 {1 flow} other {# flows}} on {group}, which has no workers online": "",
+ "{count, plural, =1 {1 flow} other {# flows}} on {group}": "",
+ "{count, plural, =1 {1 flow moves} other {# flows move}}; {kept, plural, =1 {1 keeps its own group.} other {# keep their own group.}}": "",
+ "{count, plural, =1 {Its 1 flow moves too.} other {Its # flows move too.}}": "",
+ "worker groups": "",
+ "Where does a project or flow run?": "",
+ "Flows in {project}": "",
+ "These flows run on {group}, the project’s group, unless you pick another group for a flow.": "",
+ "This project has no flows.": "",
+ "This group name is not allowed.": "",
+ "2d": "",
+ "First {shown, number} of {total, number}. Type to narrow.": "",
+ "Moved {done, number} of {total, number}. The rest could not be moved.": "",
+ "Nothing was left to move.": "",
+ "canvas": "",
+ "cursor": "",
+ "group": "",
+ "name": "",
+ "q": "",
+ "The most runs of one project at the same time. Flows with their own group are not limited by it. Extra runs wait their turn.": ""
+}
diff --git a/packages/web/public/locales/pt/translation.json b/packages/web/public/locales/pt/translation.json
index f5ca5fd6347..51d732634e8 100644
--- a/packages/web/public/locales/pt/translation.json
+++ b/packages/web/public/locales/pt/translation.json
@@ -1554,28 +1554,13 @@
"No trigger data available": "Sem dados de gatilho disponíveis",
"Trigger health information will appear here": "Disparar informações de saúde aparecerá aqui",
"trigger status": "trigger status",
- "in this group": "in this group",
- "currently in {group} — will move here": "currently in {group} — will move here",
- "shared queue": "shared queue",
- "Assign projects": "Assign projects",
"These projects will run on this group's dedicated queue.": "These projects will run on this group's dedicated queue.",
- "No projects": "No projects",
- "{count, plural, =1 {worker} other {workers}}": "{count, plural, =1 {worker} other {workers}}",
- "{count} total concurrencies": "{count} total concurrencies",
- "Assign": "Assign",
"+{count} more": "+{count} mais",
- "Allocate capacity per project — pick its worker group and concurrency limit. Leave the limit empty to inherit the platform default. Project settings shows these read-only and links here.": "Allocate capacity per project — pick its worker group and concurrency limit. Leave the limit empty to inherit the platform default. Project settings shows these read-only and links here.",
"projects": "projetos",
- "No projects yet": "No projects yet",
"Start by creating projects to manage your automation teams": "Comece criando projetos para gerenciar seus times de automação",
- "Assigned worker": "Assigned worker",
"Concurrency limit": "Concurrency limit",
"Saved": "Saved",
- "Failed to save": "Failed to save",
"Shared": "Compartilhado",
- "{group} has no workers online. Runs will wait in its queue": "{group} has no workers online. Runs will wait in its queue",
- "Default {count}": "Default {count}",
- "Concurrency limit must be a positive number": "Concurrency limit must be a positive number",
"Check the health of your workers": "Verifique a saúde de seus workers",
"Upgrade to Dedicated Workers": "Atualize para os Trabalhadores Dedicados",
"Your automations run on shared workers where strict sandboxing adds overhead to every execution. Dedicated workers give you your own execution pool that stays warm and ready, so your automations start much faster.": "Suas automações são executadas em funcionários compartilhados, onde a área restrita adiciona maior profundidade a cada execução. Trabalhadores dedicados lhe dão sua própria pool de execução que permanece quente e pronto, para que suas automações comecem muito mais rápido.",
@@ -1583,8 +1568,6 @@
"Your workers run exclusively for your platform. The execution pool stays warm with no sandboxing overhead, so your automations start instantly.": "Seus funcionários são executados exclusivamente por sua plataforma. O pool de execução permanece quente sem sandboxing na cabeça, para que suas automações comecem instantaneamente.",
"No workers found": "Nenhum trabalhador encontrado",
"You don't have any workers yet. Spin up new workers to execute your automations": "Você ainda não tem nenhum funcionário. Abra novos operários para executar suas automações",
- "Unlock Worker Groups": "Unlock Worker Groups",
- "Reserve dedicated worker capacity for specific projects so a busy project never slows down the rest": "Reserve dedicated worker capacity for specific projects so a busy project never slows down the rest",
"Dedicated": "Dedicado",
"This worker runs the projects assigned to the {group} group.": "This worker runs the projects assigned to the {group} group.",
"This worker runs exclusively for your platform with no sandboxing overhead.": "Este trabalhador é exclusivamente responsável por sua plataforma sem cobertura de areia.",
@@ -1598,9 +1581,6 @@
"Box": "Box",
"Busy": "Ocupado",
"Idle": "Idle",
- "Worker groups reserve a dedicated queue for the projects you assign. Defined in your deployment with AP_WORKER_GROUP_ID.": "Worker groups reserve a dedicated queue for the projects you assign. Defined in your deployment with AP_WORKER_GROUP_ID.",
- "By project": "By project",
- "By group": "By group",
"Configs": "Configurações",
"Variable": "Variável",
"Created": "Criado",
@@ -3378,5 +3358,148 @@
"People can no longer sign in with email and password.": "People can no longer sign in with email and password.",
"Couldn't disable single sign-on": "Couldn't disable single sign-on",
"Couldn't save single sign-on settings": "Couldn't save single sign-on settings",
- "To change the connection, paste both values again.": "To change the connection, paste both values again."
-}
\ No newline at end of file
+ "To change the connection, paste both values again.": "To change the connection, paste both values again.",
+ "Worker groups guide": "",
+ "Start a worker": "",
+ "Unlock worker groups": "",
+ "Set aside servers for specific projects or flows, so a busy project never slows down the rest.": "",
+ "Add projects": "",
+ "Add flows": "",
+ "Add {count, plural, =1 {1 project} other {# projects}}": "",
+ "Add {count, plural, =1 {1 flow} other {# flows}}": "",
+ "Add projects to {group}": "",
+ "Add flows to {group}": "",
+ "The projects you pick, and their flows, will run on this group.": "",
+ "The flows you pick will run on this group instead of their project’s group.": "",
+ "Now on {group}": "",
+ "Nothing matches your search.": "",
+ "Nothing to add.": "",
+ "This group has no workers online. Runs will wait until a worker is back.": "",
+ "first {shown} of {total} shown, search to find others": "",
+ "Find a project": "",
+ "No projects match your search.": "",
+ "Flow groups": "",
+ "Project groups": "",
+ "Only the flows picked here run on these servers. Their projects stay where they are.": "",
+ "Each project here runs with all its flows, unless a flow has its own group.": "",
+ "{count, plural, =1 {1 flow} other {{countText} flows}}": "",
+ "{count, plural, =1 {1 project} other {{countText} projects}}": "",
+ "View projects": "",
+ "not in a group": "",
+ "{count, plural, =1 {1 run waiting} other {# runs waiting}}": "",
+ "{count, plural, =1 {1 worker online} other {# workers online}}": "",
+ "No workers online": "",
+ "Not in use": "",
+ "Concurrency {count, number}": "",
+ "No runs waiting": "",
+ "No workers use this name": "",
+ "Nothing yet": "",
+ "+{count, number} more": "",
+ "Open": "",
+ "Open {group}": "",
+ "All groups": "",
+ "Group not found": "",
+ "No worker group called {name} exists on this platform. It may have been renamed, or its workers stopped.": "",
+ "Back to all groups": "",
+ "Projects that are not in a group run here, with their flows.": "",
+ "Only the flows listed here run on this group. Their projects stay where they are.": "",
+ "The projects listed here run on this group, with all their flows, unless a flow has its own group.": "",
+ "Workers join this group with": "",
+ "Move all to…": "",
+ "Runs sent here wait until a worker is back. Move its flows to another group to keep them running.": "",
+ "Runs sent here wait until a worker is back. Move its projects to another group to keep them running.": "",
+ "No flows run on this group yet. Use Add flows to pick some.": "",
+ "Every project is in a group.": "",
+ "No projects run on this group yet. Use Add projects to pick some.": "",
+ "Could not move. Nothing was changed.": "",
+ "Move undone.": "",
+ "Could not undo the move.": "",
+ "{project} now uses the default concurrency limit.": "",
+ "{project} now has a concurrency limit of {count, number}.": "",
+ "Could not save the concurrency limit. Nothing was changed.": "",
+ "Shared workers": "",
+ "{workers, plural, =1 {1 worker} other {# workers}} · concurrency {slots, number}": "",
+ "{projects, plural, =1 {1 project} other {{projectsText} projects}} · {flows, plural, =1 {1 flow} other {{flowsText} flows}}": "",
+ "{flows, plural, =1 {1 flow} other {{flowsText} flows}}": "",
+ "Moved {projects, plural, =1 {1 project} other {# projects}} and {flows, plural, =1 {1 flow} other {# flows}} to {group}.": "",
+ "Moved {count, plural, =1 {1 project} other {# projects}} to {group}.": "",
+ "Moved {count, plural, =1 {1 flow back to its project group.} other {# flows back to their project groups.}}": "",
+ "Moved {count, plural, =1 {1 flow} other {# flows}} to {group}.": "",
+ "{count, plural, =1 {1 waiting run went with them.} other {# waiting runs went with them.}}": "",
+ "Back to each flow’s project group": "",
+ "{count, plural, =1 {1 flow} other {# flows}}": "",
+ "{projects, plural, =1 {1 project} other {# projects}} ({flows, plural, =1 {1 flow} other {# flows}})": "",
+ "Move {count, plural, =1 {1 selected flow} other {# selected flows}}": "",
+ "Move {count, plural, =1 {1 selected project} other {# selected projects}}": "",
+ "Move all from {group}": "",
+ "{what} will move to the group you pick.": "",
+ "{count, plural, =1 {1 waiting run goes with them.} other {# waiting runs go with them.}}": "",
+ "Find a group": "",
+ "The group {group} has no workers online. Runs will wait there until a worker is back.": "",
+ "Same as project ({group})": "",
+ "Move {subject} to {group}?": "",
+ "{from}–{to} of {total}": "",
+ "Previous page": "",
+ "Next page": "",
+ "All {count, number} selected": "",
+ "Move to…": "",
+ "Select all {count, number}": "",
+ "Move {what} back to their project groups?": "",
+ "Move {what} to {group}?": "",
+ "{count, plural, =1 {1 flow moves with them.} other {# flows move with them.}}": "",
+ "{count, plural, =1 {1 of the picked items is already on {group}.} other {# of the picked items are already on {group}.}}": "",
+ "You can undo this right after.": "",
+ "Worker groups are servers set aside for specific projects or flows. Everything else runs on your shared workers.": "",
+ "No flow groups yet. Flow groups come from workers started for flows.": "",
+ "No project groups yet. Project groups come from workers started for projects.": "",
+ "How to add one": "",
+ "{count, number}": "",
+ "Default ({count, number})": "",
+ "How many runs of {project} can go at the same time. Extra runs wait their turn.": "",
+ "Enter a whole number above 0.": "",
+ "Leave it empty to use the default, {count, number}. The default comes from your plan and the group’s capacity.": "",
+ "search results": "",
+ "Nothing matches {query}.": "",
+ "{count, plural, =1 {1 result} other {{countText} results}}": "",
+ "runs on": "",
+ "in {project} runs on": "",
+ "(the project’s group)": "",
+ "You have no worker groups yet": "",
+ "Right now every project and flow runs on your shared workers. That is fine for most teams.": "",
+ "When a group helps": "",
+ "A busy project slows the others down. Give it its own servers.": "",
+ "A few flows need more memory or a GPU. Send just those flows to bigger servers.": "",
+ "A project must run in one region or network. Keep it on servers there.": "",
+ "Read the guide": "",
+ "Start one or more workers with": "",
+ ", using your own group name.": "",
+ "For a group that runs single flows instead of whole projects, also set": "",
+ "The group shows up here once a worker is online. Then add projects or flows to it.": "",
+ "Worker group": "",
+ "No flows match your search.": "",
+ "Select {name}": "",
+ "View flows": "",
+ "Select all on this page": "",
+ "{count, plural, =1 {1 flow runs on {group}} other {# flows run on {group}}}": "",
+ "{count, plural, =1 {1 flow runs on another group} other {# flows run on other groups}}": "",
+ "{count, plural, =1 {1 flow} other {# flows}} on {group}, which has no workers online": "",
+ "{count, plural, =1 {1 flow} other {# flows}} on {group}": "",
+ "{count, plural, =1 {1 flow moves} other {# flows move}}; {kept, plural, =1 {1 keeps its own group.} other {# keep their own group.}}": "",
+ "{count, plural, =1 {Its 1 flow moves too.} other {Its # flows move too.}}": "",
+ "worker groups": "",
+ "Where does a project or flow run?": "",
+ "Flows in {project}": "",
+ "These flows run on {group}, the project’s group, unless you pick another group for a flow.": "",
+ "This project has no flows.": "",
+ "This group name is not allowed.": "",
+ "2d": "",
+ "First {shown, number} of {total, number}. Type to narrow.": "",
+ "Moved {done, number} of {total, number}. The rest could not be moved.": "",
+ "Nothing was left to move.": "",
+ "canvas": "",
+ "cursor": "",
+ "group": "",
+ "name": "",
+ "q": "",
+ "The most runs of one project at the same time. Flows with their own group are not limited by it. Extra runs wait their turn.": ""
+}
diff --git a/packages/web/public/locales/zh-TW/translation.json b/packages/web/public/locales/zh-TW/translation.json
index 0f1cbdd304c..116eeafc3da 100644
--- a/packages/web/public/locales/zh-TW/translation.json
+++ b/packages/web/public/locales/zh-TW/translation.json
@@ -1556,28 +1556,13 @@
"No trigger data available": "",
"Trigger health information will appear here": "",
"trigger status": "",
- "in this group": "",
- "currently in {group} — will move here": "",
- "shared queue": "",
- "Assign projects": "",
"These projects will run on this group's dedicated queue.": "",
- "No projects": "",
- "{count, plural, =1 {worker} other {workers}}": "",
- "{count} total concurrencies": "",
- "Assign": "",
"+{count} more": "",
- "Allocate capacity per project — pick its worker group and concurrency limit. Leave the limit empty to inherit the platform default. Project settings shows these read-only and links here.": "",
"projects": "",
- "No projects yet": "",
"Start by creating projects to manage your automation teams": "",
- "Assigned worker": "",
"Concurrency limit": "",
"Saved": "",
- "Failed to save": "",
"Shared": "",
- "{group} has no workers online. Runs will wait in its queue": "",
- "Default {count}": "",
- "Concurrency limit must be a positive number": "",
"Check the health of your workers": "",
"Upgrade to Dedicated Workers": "",
"Your automations run on shared workers where strict sandboxing adds overhead to every execution. Dedicated workers give you your own execution pool that stays warm and ready, so your automations start much faster.": "",
@@ -1585,8 +1570,6 @@
"Your workers run exclusively for your platform. The execution pool stays warm with no sandboxing overhead, so your automations start instantly.": "",
"No workers found": "",
"You don't have any workers yet. Spin up new workers to execute your automations": "",
- "Unlock Worker Groups": "",
- "Reserve dedicated worker capacity for specific projects so a busy project never slows down the rest": "",
"Dedicated": "",
"This worker runs the projects assigned to the {group} group.": "",
"This worker runs exclusively for your platform with no sandboxing overhead.": "",
@@ -1600,9 +1583,6 @@
"Box": "",
"Busy": "",
"Idle": "",
- "Worker groups reserve a dedicated queue for the projects you assign. Defined in your deployment with AP_WORKER_GROUP_ID.": "",
- "By project": "",
- "By group": "",
"Configs": "",
"Variable": "",
"Created": "",
@@ -3277,5 +3257,148 @@
"1 min ago": "",
"{count} mins ago": "",
"1 hour ago": "",
- "{count} hours ago": ""
+ "{count} hours ago": "",
+ "Worker groups guide": "",
+ "Start a worker": "",
+ "Unlock worker groups": "",
+ "Set aside servers for specific projects or flows, so a busy project never slows down the rest.": "",
+ "Add projects": "",
+ "Add flows": "",
+ "Add {count, plural, =1 {1 project} other {# projects}}": "",
+ "Add {count, plural, =1 {1 flow} other {# flows}}": "",
+ "Add projects to {group}": "",
+ "Add flows to {group}": "",
+ "The projects you pick, and their flows, will run on this group.": "",
+ "The flows you pick will run on this group instead of their project’s group.": "",
+ "Now on {group}": "",
+ "Nothing matches your search.": "",
+ "Nothing to add.": "",
+ "This group has no workers online. Runs will wait until a worker is back.": "",
+ "first {shown} of {total} shown, search to find others": "",
+ "Find a project": "",
+ "No projects match your search.": "",
+ "Flow groups": "",
+ "Project groups": "",
+ "Only the flows picked here run on these servers. Their projects stay where they are.": "",
+ "Each project here runs with all its flows, unless a flow has its own group.": "",
+ "{count, plural, =1 {1 flow} other {{countText} flows}}": "",
+ "{count, plural, =1 {1 project} other {{countText} projects}}": "",
+ "View projects": "",
+ "not in a group": "",
+ "{count, plural, =1 {1 run waiting} other {# runs waiting}}": "",
+ "{count, plural, =1 {1 worker online} other {# workers online}}": "",
+ "No workers online": "",
+ "Not in use": "",
+ "Concurrency {count, number}": "",
+ "No runs waiting": "",
+ "No workers use this name": "",
+ "Nothing yet": "",
+ "+{count, number} more": "",
+ "Open": "",
+ "Open {group}": "",
+ "All groups": "",
+ "Group not found": "",
+ "No worker group called {name} exists on this platform. It may have been renamed, or its workers stopped.": "",
+ "Back to all groups": "",
+ "Projects that are not in a group run here, with their flows.": "",
+ "Only the flows listed here run on this group. Their projects stay where they are.": "",
+ "The projects listed here run on this group, with all their flows, unless a flow has its own group.": "",
+ "Workers join this group with": "",
+ "Move all to…": "",
+ "Runs sent here wait until a worker is back. Move its flows to another group to keep them running.": "",
+ "Runs sent here wait until a worker is back. Move its projects to another group to keep them running.": "",
+ "No flows run on this group yet. Use Add flows to pick some.": "",
+ "Every project is in a group.": "",
+ "No projects run on this group yet. Use Add projects to pick some.": "",
+ "Could not move. Nothing was changed.": "",
+ "Move undone.": "",
+ "Could not undo the move.": "",
+ "{project} now uses the default concurrency limit.": "",
+ "{project} now has a concurrency limit of {count, number}.": "",
+ "Could not save the concurrency limit. Nothing was changed.": "",
+ "Shared workers": "",
+ "{workers, plural, =1 {1 worker} other {# workers}} · concurrency {slots, number}": "",
+ "{projects, plural, =1 {1 project} other {{projectsText} projects}} · {flows, plural, =1 {1 flow} other {{flowsText} flows}}": "",
+ "{flows, plural, =1 {1 flow} other {{flowsText} flows}}": "",
+ "Moved {projects, plural, =1 {1 project} other {# projects}} and {flows, plural, =1 {1 flow} other {# flows}} to {group}.": "",
+ "Moved {count, plural, =1 {1 project} other {# projects}} to {group}.": "",
+ "Moved {count, plural, =1 {1 flow back to its project group.} other {# flows back to their project groups.}}": "",
+ "Moved {count, plural, =1 {1 flow} other {# flows}} to {group}.": "",
+ "{count, plural, =1 {1 waiting run went with them.} other {# waiting runs went with them.}}": "",
+ "Back to each flow’s project group": "",
+ "{count, plural, =1 {1 flow} other {# flows}}": "",
+ "{projects, plural, =1 {1 project} other {# projects}} ({flows, plural, =1 {1 flow} other {# flows}})": "",
+ "Move {count, plural, =1 {1 selected flow} other {# selected flows}}": "",
+ "Move {count, plural, =1 {1 selected project} other {# selected projects}}": "",
+ "Move all from {group}": "",
+ "{what} will move to the group you pick.": "",
+ "{count, plural, =1 {1 waiting run goes with them.} other {# waiting runs go with them.}}": "",
+ "Find a group": "",
+ "The group {group} has no workers online. Runs will wait there until a worker is back.": "",
+ "Same as project ({group})": "",
+ "Move {subject} to {group}?": "",
+ "{from}–{to} of {total}": "",
+ "Previous page": "",
+ "Next page": "",
+ "All {count, number} selected": "",
+ "Move to…": "",
+ "Select all {count, number}": "",
+ "Move {what} back to their project groups?": "",
+ "Move {what} to {group}?": "",
+ "{count, plural, =1 {1 flow moves with them.} other {# flows move with them.}}": "",
+ "{count, plural, =1 {1 of the picked items is already on {group}.} other {# of the picked items are already on {group}.}}": "",
+ "You can undo this right after.": "",
+ "Worker groups are servers set aside for specific projects or flows. Everything else runs on your shared workers.": "",
+ "No flow groups yet. Flow groups come from workers started for flows.": "",
+ "No project groups yet. Project groups come from workers started for projects.": "",
+ "How to add one": "",
+ "{count, number}": "",
+ "Default ({count, number})": "",
+ "How many runs of {project} can go at the same time. Extra runs wait their turn.": "",
+ "Enter a whole number above 0.": "",
+ "Leave it empty to use the default, {count, number}. The default comes from your plan and the group’s capacity.": "",
+ "search results": "",
+ "Nothing matches {query}.": "",
+ "{count, plural, =1 {1 result} other {{countText} results}}": "",
+ "runs on": "",
+ "in {project} runs on": "",
+ "(the project’s group)": "",
+ "You have no worker groups yet": "",
+ "Right now every project and flow runs on your shared workers. That is fine for most teams.": "",
+ "When a group helps": "",
+ "A busy project slows the others down. Give it its own servers.": "",
+ "A few flows need more memory or a GPU. Send just those flows to bigger servers.": "",
+ "A project must run in one region or network. Keep it on servers there.": "",
+ "Read the guide": "",
+ "Start one or more workers with": "",
+ ", using your own group name.": "",
+ "For a group that runs single flows instead of whole projects, also set": "",
+ "The group shows up here once a worker is online. Then add projects or flows to it.": "",
+ "Worker group": "",
+ "No flows match your search.": "",
+ "Select {name}": "",
+ "View flows": "",
+ "Select all on this page": "",
+ "{count, plural, =1 {1 flow runs on {group}} other {# flows run on {group}}}": "",
+ "{count, plural, =1 {1 flow runs on another group} other {# flows run on other groups}}": "",
+ "{count, plural, =1 {1 flow} other {# flows}} on {group}, which has no workers online": "",
+ "{count, plural, =1 {1 flow} other {# flows}} on {group}": "",
+ "{count, plural, =1 {1 flow moves} other {# flows move}}; {kept, plural, =1 {1 keeps its own group.} other {# keep their own group.}}": "",
+ "{count, plural, =1 {Its 1 flow moves too.} other {Its # flows move too.}}": "",
+ "worker groups": "",
+ "Where does a project or flow run?": "",
+ "Flows in {project}": "",
+ "These flows run on {group}, the project’s group, unless you pick another group for a flow.": "",
+ "This project has no flows.": "",
+ "This group name is not allowed.": "",
+ "2d": "",
+ "First {shown, number} of {total, number}. Type to narrow.": "",
+ "Moved {done, number} of {total, number}. The rest could not be moved.": "",
+ "Nothing was left to move.": "",
+ "canvas": "",
+ "cursor": "",
+ "group": "",
+ "name": "",
+ "q": "",
+ "The most runs of one project at the same time. Flows with their own group are not limited by it. Extra runs wait their turn.": ""
}
diff --git a/packages/web/public/locales/zh/translation.json b/packages/web/public/locales/zh/translation.json
index 46f9b492cbd..c7af539f9a3 100644
--- a/packages/web/public/locales/zh/translation.json
+++ b/packages/web/public/locales/zh/translation.json
@@ -1554,28 +1554,13 @@
"No trigger data available": "No trigger data available",
"Trigger health information will appear here": "Trigger health information will appear here",
"trigger status": "trigger status",
- "in this group": "in this group",
- "currently in {group} — will move here": "currently in {group} — will move here",
- "shared queue": "shared queue",
- "Assign projects": "Assign projects",
"These projects will run on this group's dedicated queue.": "These projects will run on this group's dedicated queue.",
- "No projects": "No projects",
- "{count, plural, =1 {worker} other {workers}}": "{count, plural, =1 {worker} other {workers}}",
- "{count} total concurrencies": "{count} total concurrencies",
- "Assign": "Assign",
"+{count} more": "多出+{count}",
- "Allocate capacity per project — pick its worker group and concurrency limit. Leave the limit empty to inherit the platform default. Project settings shows these read-only and links here.": "Allocate capacity per project — pick its worker group and concurrency limit. Leave the limit empty to inherit the platform default. Project settings shows these read-only and links here.",
"projects": "projects",
- "No projects yet": "No projects yet",
"Start by creating projects to manage your automation teams": "创建项目来管理您的自动化团队",
- "Assigned worker": "Assigned worker",
"Concurrency limit": "Concurrency limit",
"Saved": "Saved",
- "Failed to save": "Failed to save",
"Shared": "共享",
- "{group} has no workers online. Runs will wait in its queue": "{group} has no workers online. Runs will wait in its queue",
- "Default {count}": "Default {count}",
- "Concurrency limit must be a positive number": "Concurrency limit must be a positive number",
"Check the health of your workers": "Check the health of your workers",
"Upgrade to Dedicated Workers": "Upgrade to Dedicated Workers",
"Your automations run on shared workers where strict sandboxing adds overhead to every execution. Dedicated workers give you your own execution pool that stays warm and ready, so your automations start much faster.": "Your automations run on shared workers where strict sandboxing adds overhead to every execution. Dedicated workers give you your own execution pool that stays warm and ready, so your automations start much faster.",
@@ -1583,8 +1568,6 @@
"Your workers run exclusively for your platform. The execution pool stays warm with no sandboxing overhead, so your automations start instantly.": "Your workers run exclusively for your platform. The execution pool stays warm with no sandboxing overhead, so your automations start instantly.",
"No workers found": "找不到工人",
"You don't have any workers yet. Spin up new workers to execute your automations": "You don't have any workers yet. Spin up new workers to execute your automations",
- "Unlock Worker Groups": "Unlock Worker Groups",
- "Reserve dedicated worker capacity for specific projects so a busy project never slows down the rest": "Reserve dedicated worker capacity for specific projects so a busy project never slows down the rest",
"Dedicated": "專用",
"This worker runs the projects assigned to the {group} group.": "This worker runs the projects assigned to the {group} group.",
"This worker runs exclusively for your platform with no sandboxing overhead.": "This worker runs exclusively for your platform with no sandboxing overhead.",
@@ -1598,9 +1581,6 @@
"Box": "Box",
"Busy": "Busy",
"Idle": "Idle",
- "Worker groups reserve a dedicated queue for the projects you assign. Defined in your deployment with AP_WORKER_GROUP_ID.": "Worker groups reserve a dedicated queue for the projects you assign. Defined in your deployment with AP_WORKER_GROUP_ID.",
- "By project": "By project",
- "By group": "By group",
"Configs": "配置",
"Variable": "變數",
"Created": "已创建",
@@ -3378,5 +3358,148 @@
"People can no longer sign in with email and password.": "People can no longer sign in with email and password.",
"Couldn't disable single sign-on": "Couldn't disable single sign-on",
"Couldn't save single sign-on settings": "Couldn't save single sign-on settings",
- "To change the connection, paste both values again.": "To change the connection, paste both values again."
-}
\ No newline at end of file
+ "To change the connection, paste both values again.": "To change the connection, paste both values again.",
+ "Worker groups guide": "",
+ "Start a worker": "",
+ "Unlock worker groups": "",
+ "Set aside servers for specific projects or flows, so a busy project never slows down the rest.": "",
+ "Add projects": "",
+ "Add flows": "",
+ "Add {count, plural, =1 {1 project} other {# projects}}": "",
+ "Add {count, plural, =1 {1 flow} other {# flows}}": "",
+ "Add projects to {group}": "",
+ "Add flows to {group}": "",
+ "The projects you pick, and their flows, will run on this group.": "",
+ "The flows you pick will run on this group instead of their project’s group.": "",
+ "Now on {group}": "",
+ "Nothing matches your search.": "",
+ "Nothing to add.": "",
+ "This group has no workers online. Runs will wait until a worker is back.": "",
+ "first {shown} of {total} shown, search to find others": "",
+ "Find a project": "",
+ "No projects match your search.": "",
+ "Flow groups": "",
+ "Project groups": "",
+ "Only the flows picked here run on these servers. Their projects stay where they are.": "",
+ "Each project here runs with all its flows, unless a flow has its own group.": "",
+ "{count, plural, =1 {1 flow} other {{countText} flows}}": "",
+ "{count, plural, =1 {1 project} other {{countText} projects}}": "",
+ "View projects": "",
+ "not in a group": "",
+ "{count, plural, =1 {1 run waiting} other {# runs waiting}}": "",
+ "{count, plural, =1 {1 worker online} other {# workers online}}": "",
+ "No workers online": "",
+ "Not in use": "",
+ "Concurrency {count, number}": "",
+ "No runs waiting": "",
+ "No workers use this name": "",
+ "Nothing yet": "",
+ "+{count, number} more": "",
+ "Open": "",
+ "Open {group}": "",
+ "All groups": "",
+ "Group not found": "",
+ "No worker group called {name} exists on this platform. It may have been renamed, or its workers stopped.": "",
+ "Back to all groups": "",
+ "Projects that are not in a group run here, with their flows.": "",
+ "Only the flows listed here run on this group. Their projects stay where they are.": "",
+ "The projects listed here run on this group, with all their flows, unless a flow has its own group.": "",
+ "Workers join this group with": "",
+ "Move all to…": "",
+ "Runs sent here wait until a worker is back. Move its flows to another group to keep them running.": "",
+ "Runs sent here wait until a worker is back. Move its projects to another group to keep them running.": "",
+ "No flows run on this group yet. Use Add flows to pick some.": "",
+ "Every project is in a group.": "",
+ "No projects run on this group yet. Use Add projects to pick some.": "",
+ "Could not move. Nothing was changed.": "",
+ "Move undone.": "",
+ "Could not undo the move.": "",
+ "{project} now uses the default concurrency limit.": "",
+ "{project} now has a concurrency limit of {count, number}.": "",
+ "Could not save the concurrency limit. Nothing was changed.": "",
+ "Shared workers": "",
+ "{workers, plural, =1 {1 worker} other {# workers}} · concurrency {slots, number}": "",
+ "{projects, plural, =1 {1 project} other {{projectsText} projects}} · {flows, plural, =1 {1 flow} other {{flowsText} flows}}": "",
+ "{flows, plural, =1 {1 flow} other {{flowsText} flows}}": "",
+ "Moved {projects, plural, =1 {1 project} other {# projects}} and {flows, plural, =1 {1 flow} other {# flows}} to {group}.": "",
+ "Moved {count, plural, =1 {1 project} other {# projects}} to {group}.": "",
+ "Moved {count, plural, =1 {1 flow back to its project group.} other {# flows back to their project groups.}}": "",
+ "Moved {count, plural, =1 {1 flow} other {# flows}} to {group}.": "",
+ "{count, plural, =1 {1 waiting run went with them.} other {# waiting runs went with them.}}": "",
+ "Back to each flow’s project group": "",
+ "{count, plural, =1 {1 flow} other {# flows}}": "",
+ "{projects, plural, =1 {1 project} other {# projects}} ({flows, plural, =1 {1 flow} other {# flows}})": "",
+ "Move {count, plural, =1 {1 selected flow} other {# selected flows}}": "",
+ "Move {count, plural, =1 {1 selected project} other {# selected projects}}": "",
+ "Move all from {group}": "",
+ "{what} will move to the group you pick.": "",
+ "{count, plural, =1 {1 waiting run goes with them.} other {# waiting runs go with them.}}": "",
+ "Find a group": "",
+ "The group {group} has no workers online. Runs will wait there until a worker is back.": "",
+ "Same as project ({group})": "",
+ "Move {subject} to {group}?": "",
+ "{from}–{to} of {total}": "",
+ "Previous page": "",
+ "Next page": "",
+ "All {count, number} selected": "",
+ "Move to…": "",
+ "Select all {count, number}": "",
+ "Move {what} back to their project groups?": "",
+ "Move {what} to {group}?": "",
+ "{count, plural, =1 {1 flow moves with them.} other {# flows move with them.}}": "",
+ "{count, plural, =1 {1 of the picked items is already on {group}.} other {# of the picked items are already on {group}.}}": "",
+ "You can undo this right after.": "",
+ "Worker groups are servers set aside for specific projects or flows. Everything else runs on your shared workers.": "",
+ "No flow groups yet. Flow groups come from workers started for flows.": "",
+ "No project groups yet. Project groups come from workers started for projects.": "",
+ "How to add one": "",
+ "{count, number}": "",
+ "Default ({count, number})": "",
+ "How many runs of {project} can go at the same time. Extra runs wait their turn.": "",
+ "Enter a whole number above 0.": "",
+ "Leave it empty to use the default, {count, number}. The default comes from your plan and the group’s capacity.": "",
+ "search results": "",
+ "Nothing matches {query}.": "",
+ "{count, plural, =1 {1 result} other {{countText} results}}": "",
+ "runs on": "",
+ "in {project} runs on": "",
+ "(the project’s group)": "",
+ "You have no worker groups yet": "",
+ "Right now every project and flow runs on your shared workers. That is fine for most teams.": "",
+ "When a group helps": "",
+ "A busy project slows the others down. Give it its own servers.": "",
+ "A few flows need more memory or a GPU. Send just those flows to bigger servers.": "",
+ "A project must run in one region or network. Keep it on servers there.": "",
+ "Read the guide": "",
+ "Start one or more workers with": "",
+ ", using your own group name.": "",
+ "For a group that runs single flows instead of whole projects, also set": "",
+ "The group shows up here once a worker is online. Then add projects or flows to it.": "",
+ "Worker group": "",
+ "No flows match your search.": "",
+ "Select {name}": "",
+ "View flows": "",
+ "Select all on this page": "",
+ "{count, plural, =1 {1 flow runs on {group}} other {# flows run on {group}}}": "",
+ "{count, plural, =1 {1 flow runs on another group} other {# flows run on other groups}}": "",
+ "{count, plural, =1 {1 flow} other {# flows}} on {group}, which has no workers online": "",
+ "{count, plural, =1 {1 flow} other {# flows}} on {group}": "",
+ "{count, plural, =1 {1 flow moves} other {# flows move}}; {kept, plural, =1 {1 keeps its own group.} other {# keep their own group.}}": "",
+ "{count, plural, =1 {Its 1 flow moves too.} other {Its # flows move too.}}": "",
+ "worker groups": "",
+ "Where does a project or flow run?": "",
+ "Flows in {project}": "",
+ "These flows run on {group}, the project’s group, unless you pick another group for a flow.": "",
+ "This project has no flows.": "",
+ "This group name is not allowed.": "",
+ "2d": "",
+ "First {shown, number} of {total, number}. Type to narrow.": "",
+ "Moved {done, number} of {total, number}. The rest could not be moved.": "",
+ "Nothing was left to move.": "",
+ "canvas": "",
+ "cursor": "",
+ "group": "",
+ "name": "",
+ "q": "",
+ "The most runs of one project at the same time. Flows with their own group are not limited by it. Extra runs wait their turn.": ""
+}
diff --git a/packages/web/src/app/components/admin/admin-page-resources.ts b/packages/web/src/app/components/admin/admin-page-resources.ts
index cb9bdc25ce9..7019f7d6046 100644
--- a/packages/web/src/app/components/admin/admin-page-resources.ts
+++ b/packages/web/src/app/components/admin/admin-page-resources.ts
@@ -124,6 +124,16 @@ export const adminPageResources = {
path: 'admin-guide/guides/workers',
}),
],
+ workerGroups: [
+ docs({
+ label: () => t('Worker groups guide'),
+ path: 'install/configure-operate/worker-groups',
+ }),
+ docs({
+ label: () => t('Start a worker'),
+ path: 'install/configure-operate/separate-workers',
+ }),
+ ],
health: [
docs({ label: () => t('Health guide'), path: 'admin-guide/guides/health' }),
],
diff --git a/packages/web/src/app/routes/platform/infra/workers/assign-flows-dialog.tsx b/packages/web/src/app/routes/platform/infra/workers/assign-flows-dialog.tsx
deleted file mode 100644
index 6a40102f841..00000000000
--- a/packages/web/src/app/routes/platform/infra/workers/assign-flows-dialog.tsx
+++ /dev/null
@@ -1,297 +0,0 @@
-import {
- isNil,
- SeekPage,
- PopulatedFlow,
- ProjectType,
- ProjectWithLimits,
-} from '@activepieces/shared';
-import { useQuery, useQueryClient } from '@tanstack/react-query';
-import { t } from 'i18next';
-import { Search, Workflow } from 'lucide-react';
-import { useState } from 'react';
-import { toast } from 'sonner';
-
-import { DataFetchErrorState } from '@/components/custom/data-fetch-error-state';
-import { TextWithTooltip } from '@/components/custom/text-with-tooltip';
-import { Button } from '@/components/ui/button';
-import { Checkbox } from '@/components/ui/checkbox';
-import {
- Dialog,
- DialogContent,
- DialogDescription,
- DialogFooter,
- DialogHeader,
- DialogTitle,
-} from '@/components/ui/dialog';
-import { Input } from '@/components/ui/input';
-import { ScrollArea } from '@/components/ui/scroll-area';
-import {
- Select,
- SelectContent,
- SelectItem,
- SelectTrigger,
- SelectValue,
-} from '@/components/ui/select';
-import { workersApi } from '@/features/platform-admin/api/workers-api';
-import { AdminControl, adminControl } from '@/lib/admin-control';
-import { api } from '@/lib/api';
-import { cn } from '@/lib/utils';
-
-import { ProjectAvatar } from './project-avatar';
-
-const DIALOG_PAGE_SIZE = 100;
-
-export function AssignFlowsDialog({
- open,
- onOpenChange,
- groupLabel,
- allProjects,
-}: AssignFlowsDialogProps) {
- return (
- <Dialog open={open} onOpenChange={onOpenChange}>
- <DialogContent className="max-w-lg">
- <AssignFlowsContent
- key={open ? `open-${groupLabel}` : 'closed'}
- groupLabel={groupLabel}
- allProjects={allProjects}
- onOpenChange={onOpenChange}
- />
- </DialogContent>
- </Dialog>
- );
-}
-
-function AssignFlowsContent({
- groupLabel,
- allProjects,
- onOpenChange,
-}: AssignFlowsContentProps) {
- const queryClient = useQueryClient();
- const defaultProject =
- allProjects.find((project) => project.type === ProjectType.TEAM) ??
- allProjects[0];
- const [selectedProjectId, setSelectedProjectId] = useState<
- string | undefined
- >(defaultProject?.id);
- const [search, setSearch] = useState('');
- const [pendingChanges, setPendingChanges] = useState<Map<string, boolean>>(
- new Map(),
- );
- const [saving, setSaving] = useState(false);
-
- const {
- data: page,
- isLoading,
- isError,
- refetch,
- } = useQuery<SeekPage<PopulatedFlow>>({
- queryKey: ['assign-flows-dialog', selectedProjectId, search],
- queryFn: () =>
- api.get<SeekPage<PopulatedFlow>>('/v1/flows', {
- projectId: selectedProjectId,
- limit: DIALOG_PAGE_SIZE,
- name: search || undefined,
- }),
- enabled: !isNil(selectedProjectId),
- });
- const flows = page?.data ?? [];
-
- const isInGroup = (flow: PopulatedFlow): boolean =>
- pendingChanges.get(flow.id) ?? flow.workerGroupId === groupLabel;
-
- const toggleFlow = (flow: PopulatedFlow) => {
- if (saving) {
- return;
- }
- setPendingChanges((prev) => {
- const next = new Map(prev);
- const desired = !isInGroup(flow);
- if (desired === (flow.workerGroupId === groupLabel)) {
- next.delete(flow.id);
- } else {
- next.set(flow.id, desired);
- }
- return next;
- });
- };
-
- const handleSave = async () => {
- if (saving) {
- return;
- }
- setSaving(true);
- try {
- for (const [flowId, assign] of pendingChanges) {
- await workersApi.assignFlow(flowId, assign ? groupLabel : null);
- }
- if (pendingChanges.size > 0) {
- await queryClient.invalidateQueries({
- queryKey: ['worker-groups-flows'],
- });
- await queryClient.invalidateQueries({
- queryKey: ['worker-group-assigned-flows'],
- });
- toast.success(t('Saved'));
- }
- onOpenChange(false);
- } catch {
- toast.error(t('Failed to save'));
- } finally {
- setSaving(false);
- }
- };
-
- const getSubtitle = (flow: PopulatedFlow): string => {
- if (flow.workerGroupId === groupLabel) {
- return t('in this group');
- }
- if (flow.workerGroupId) {
- return t('currently in {group} — will move here', {
- group: flow.workerGroupId.replaceAll('_', ' '),
- });
- }
- return t('project default');
- };
-
- return (
- <>
- <DialogHeader>
- <DialogTitle>{t('Assign flows')}</DialogTitle>
- <DialogDescription>
- {t("These flows will run on this group's dedicated queue.")}
- </DialogDescription>
- <div className="inline-flex items-center gap-1.5 rounded-md bg-accent-3 px-2 py-1 text-sm font-medium text-accent-11 w-fit">
- <Workflow className="size-3.5 shrink-0" />
- {groupLabel.replaceAll('_', ' ')}
- </div>
- </DialogHeader>
-
- <div className="flex flex-col gap-3">
- <Select
- value={selectedProjectId}
- onValueChange={(projectId) => setSelectedProjectId(projectId)}
- >
- <SelectTrigger>
- <SelectValue placeholder={t('Select a project')} />
- </SelectTrigger>
- <SelectContent>
- {allProjects.map((project) => (
- <SelectItem key={project.id} value={project.id}>
- <div className="flex items-center gap-2 min-w-0">
- <ProjectAvatar project={project} size="sm" />
- <span className="truncate">{project.displayName}</span>
- </div>
- </SelectItem>
- ))}
- </SelectContent>
- </Select>
-
- <div className="relative">
- <Search className="absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-gray-11" />
- <Input
- className="pl-8"
- placeholder={t('Search flows')}
- value={search}
- onChange={(e) => setSearch(e.target.value)}
- />
- </div>
-
- <ScrollArea className="h-64 rounded-md border">
- <div className="p-1">
- {isError && (
- <DataFetchErrorState entity={t('flows')} onRetry={refetch} />
- )}
- {!isError && !isLoading && flows.length === 0 && (
- <p className="py-8 text-center text-sm text-gray-11">
- {t('No flows')}
- </p>
- )}
- {flows.map((flow) => {
- const isChecked = isInGroup(flow);
- const subtitle = getSubtitle(flow);
- const isCurrentGroup = flow.workerGroupId === groupLabel;
-
- return (
- <button
- key={flow.id}
- type="button"
- className="flex w-full items-center gap-3 rounded-md px-2 py-2 text-left hover:bg-gray-4 cursor-pointer"
- disabled={saving}
- onClick={() => toggleFlow(flow)}
- >
- <Checkbox
- checked={isChecked}
- disabled={saving}
- onCheckedChange={() => toggleFlow(flow)}
- onClick={(e) => e.stopPropagation()}
- />
- <Workflow className="size-4 shrink-0 text-gray-11" />
- <div className="flex min-w-0 flex-col">
- <TextWithTooltip tooltipMessage={flow.version.displayName}>
- <span className="text-sm font-medium truncate">
- {flow.version.displayName}
- </span>
- </TextWithTooltip>
- <span
- className={cn('text-xs text-gray-11 truncate', {
- 'text-accent-11': isCurrentGroup,
- })}
- >
- {subtitle}
- </span>
- </div>
- </button>
- );
- })}
- {!isNil(page?.next) && (
- <p className="py-2 text-center text-xs text-gray-11">
- {t('Showing the first {count} flows — search to narrow down', {
- count: DIALOG_PAGE_SIZE,
- })}
- </p>
- )}
- </div>
- </ScrollArea>
- </div>
-
- <DialogFooter className="sm:justify-between">
- <span className="text-sm text-gray-11 self-center">
- {t('{count, plural, =1 {1 change} other {# changes}}', {
- count: pendingChanges.size,
- })}
- </span>
- <div className="flex gap-2">
- <Button
- type="button"
- variant="outline"
- disabled={saving}
- onClick={() => onOpenChange(false)}
- >
- {t('Cancel')}
- </Button>
- <Button
- {...adminControl(AdminControl.WORKERS_ASSIGN_SUBMIT)}
- type="button"
- loading={saving}
- onClick={handleSave}
- >
- {t('Save')}
- </Button>
- </div>
- </DialogFooter>
- </>
- );
-}
-
-type AssignFlowsDialogProps = {
- open: boolean;
- onOpenChange: (open: boolean) => void;
- groupLabel: string;
- allProjects: ProjectWithLimits[];
-};
-
-type AssignFlowsContentProps = {
- groupLabel: string;
- allProjects: ProjectWithLimits[];
- onOpenChange: (open: boolean) => void;
-};
diff --git a/packages/web/src/app/routes/platform/infra/workers/assign-projects-dialog.tsx b/packages/web/src/app/routes/platform/infra/workers/assign-projects-dialog.tsx
deleted file mode 100644
index 7a5691a953e..00000000000
--- a/packages/web/src/app/routes/platform/infra/workers/assign-projects-dialog.tsx
+++ /dev/null
@@ -1,216 +0,0 @@
-import { ProjectWithLimits } from '@activepieces/shared';
-import { t } from 'i18next';
-import { Layers, Search } from 'lucide-react';
-import { useState } from 'react';
-
-import { adminLayout } from '@/app/components/admin';
-import { TextWithTooltip } from '@/components/custom/text-with-tooltip';
-import { Button } from '@/components/ui/button';
-import { Checkbox } from '@/components/ui/checkbox';
-import {
- Dialog,
- DialogContent,
- DialogDescription,
- DialogFooter,
- DialogHeader,
- DialogTitle,
-} from '@/components/ui/dialog';
-import { Input } from '@/components/ui/input';
-import { ScrollArea } from '@/components/ui/scroll-area';
-import { workersApi } from '@/features/platform-admin/api/workers-api';
-import { projectCollectionUtils } from '@/features/projects/stores/project-collection';
-import { AdminControl, adminControl } from '@/lib/admin-control';
-import { cn } from '@/lib/utils';
-
-import { ProjectAvatar } from './project-avatar';
-
-export function AssignProjectsDialog({
- open,
- onOpenChange,
- groupLabel,
- allProjects,
-}: AssignProjectsDialogProps) {
- return (
- <Dialog open={open} onOpenChange={onOpenChange}>
- <DialogContent className={adminLayout.dialog.md}>
- <AssignProjectsContent
- key={open ? `open-${groupLabel}` : 'closed'}
- groupLabel={groupLabel}
- allProjects={allProjects}
- onOpenChange={onOpenChange}
- />
- </DialogContent>
- </Dialog>
- );
-}
-
-function AssignProjectsContent({
- groupLabel,
- allProjects,
- onOpenChange,
-}: AssignProjectsContentProps) {
- const [checkedIds, setCheckedIds] = useState<Set<string>>(
- () =>
- new Set(
- allProjects
- .filter((p) => p.workerGroupId === groupLabel)
- .map((p) => p.id),
- ),
- );
- const [search, setSearch] = useState('');
-
- const filteredProjects = allProjects.filter((p) =>
- p.displayName.toLowerCase().includes(search.toLowerCase()),
- );
-
- const toggleProject = (projectId: string) => {
- setCheckedIds((prev) => {
- const next = new Set(prev);
- if (next.has(projectId)) {
- next.delete(projectId);
- } else {
- next.add(projectId);
- }
- return next;
- });
- };
-
- const handleSave = async () => {
- let changed = false;
- for (const project of allProjects) {
- const wasInGroup = project.workerGroupId === groupLabel;
- const isNowChecked = checkedIds.has(project.id);
- if (isNowChecked && !wasInGroup) {
- await workersApi.assignProject(project.id, groupLabel);
- changed = true;
- } else if (!isNowChecked && wasInGroup) {
- await workersApi.assignProject(project.id, null);
- changed = true;
- }
- }
- if (changed) {
- await projectCollectionUtils.refetchProjects();
- }
- onOpenChange(false);
- };
-
- const getSubtitle = (project: ProjectWithLimits): string => {
- if (project.workerGroupId === groupLabel) {
- return t('in this group');
- }
- if (project.workerGroupId) {
- return t('currently in {group} — will move here', {
- group: project.workerGroupId.replaceAll('_', ' '),
- });
- }
- return t('shared queue');
- };
-
- return (
- <>
- <DialogHeader>
- <DialogTitle>{t('Assign projects')}</DialogTitle>
- <DialogDescription>
- {t("These projects will run on this group's dedicated queue.")}
- </DialogDescription>
- <div className="inline-flex items-center gap-1.5 rounded-md bg-accent-3 px-2 py-1 text-sm font-medium text-accent-11 w-fit">
- <Layers className="size-3.5 shrink-0" />
- {groupLabel.replaceAll('_', ' ')}
- </div>
- </DialogHeader>
-
- <div className="flex flex-col gap-3">
- <div className="relative">
- <Search className="absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-gray-11" />
- <Input
- className="pl-8"
- placeholder={t('Search projects')}
- value={search}
- onChange={(e) => setSearch(e.target.value)}
- />
- </div>
-
- <ScrollArea className="h-64 rounded-md border">
- <div className="p-1">
- {filteredProjects.length === 0 && (
- <p className="py-8 text-center text-sm text-gray-11">
- {t('No projects')}
- </p>
- )}
- {filteredProjects.map((project) => {
- const isChecked = checkedIds.has(project.id);
- const subtitle = getSubtitle(project);
- const isCurrentGroup = project.workerGroupId === groupLabel;
-
- return (
- <button
- key={project.id}
- type="button"
- className="flex w-full items-center gap-3 rounded-md px-2 py-2 text-left hover:bg-gray-4 cursor-pointer"
- onClick={() => toggleProject(project.id)}
- >
- <Checkbox
- checked={isChecked}
- onCheckedChange={() => toggleProject(project.id)}
- onClick={(e) => e.stopPropagation()}
- />
- <ProjectAvatar project={project} />
- <div className="flex min-w-0 flex-col">
- <TextWithTooltip tooltipMessage={project.displayName}>
- <span className="text-sm font-medium truncate">
- {project.displayName}
- </span>
- </TextWithTooltip>
- <span
- className={cn('text-xs text-gray-11 truncate', {
- 'text-accent-11': isCurrentGroup,
- })}
- >
- {subtitle}
- </span>
- </div>
- </button>
- );
- })}
- </div>
- </ScrollArea>
- </div>
-
- <DialogFooter className="sm:justify-between">
- <span className="text-sm text-gray-11 self-center">
- {checkedIds.size}{' '}
- {checkedIds.size === 1 ? t('Project') : t('Projects')}
- </span>
- <div className="flex gap-2">
- <Button
- type="button"
- variant="outline"
- onClick={() => onOpenChange(false)}
- >
- {t('Cancel')}
- </Button>
- <Button
- {...adminControl(AdminControl.WORKERS_ASSIGN_SUBMIT)}
- type="button"
- onClick={handleSave}
- >
- {t('Save')}
- </Button>
- </div>
- </DialogFooter>
- </>
- );
-}
-
-type AssignProjectsDialogProps = {
- open: boolean;
- onOpenChange: (open: boolean) => void;
- groupLabel: string;
- allProjects: ProjectWithLimits[];
-};
-
-type AssignProjectsContentProps = {
- groupLabel: string;
- allProjects: ProjectWithLimits[];
- onOpenChange: (open: boolean) => void;
-};
diff --git a/packages/web/src/app/routes/platform/infra/workers/by-flow-view.tsx b/packages/web/src/app/routes/platform/infra/workers/by-flow-view.tsx
deleted file mode 100644
index c4681714c62..00000000000
--- a/packages/web/src/app/routes/platform/infra/workers/by-flow-view.tsx
+++ /dev/null
@@ -1,319 +0,0 @@
-import {
- isNil,
- SeekPage,
- FlowStatus,
- PopulatedFlow,
- ProjectType,
- ProjectWithLimits,
- WorkerGroupScope,
-} from '@activepieces/shared';
-import { useQuery } from '@tanstack/react-query';
-import { t } from 'i18next';
-import { Cpu, Search, Workflow } from 'lucide-react';
-import { useMemo } from 'react';
-import { useSearchParams } from 'react-router-dom';
-import { toast } from 'sonner';
-
-import { DataTable, RowDataWithActions } from '@/components/custom/data-table';
-import { TextWithTooltip } from '@/components/custom/text-with-tooltip';
-import { Input } from '@/components/ui/input';
-import {
- Select,
- SelectContent,
- SelectItem,
- SelectTrigger,
- SelectValue,
-} from '@/components/ui/select';
-import {
- WorkerGroupInfo,
- workersApi,
-} from '@/features/platform-admin/api/workers-api';
-import { api } from '@/lib/api';
-import { cn } from '@/lib/utils';
-
-import { ProjectAvatar } from './project-avatar';
-
-const DEFAULT_SENTINEL = '__default__';
-const FLOW_NAME_QUERY_PARAM = 'flowName';
-const FLOW_PROJECT_QUERY_PARAM = 'flowsProject';
-
-export function ByFlowView({ projects, workerGroups }: ByFlowViewProps) {
- const [searchParams, setSearchParams] = useSearchParams();
- const cursor = searchParams.get('cursor') ?? undefined;
- const limit = searchParams.get('limit') ?? '10';
- const flowName = searchParams.get(FLOW_NAME_QUERY_PARAM) ?? undefined;
-
- const defaultProject =
- projects.find((project) => project.type === ProjectType.TEAM) ??
- projects[0];
- const projectParam = searchParams.get(FLOW_PROJECT_QUERY_PARAM);
- const selectedProjectId =
- projectParam && projects.some((project) => project.id === projectParam)
- ? projectParam
- : defaultProject?.id;
-
- const {
- data: page,
- isLoading,
- isError,
- refetch,
- } = useProjectFlowsPage({
- projectId: selectedProjectId,
- cursor,
- limit,
- name: flowName,
- });
-
- const flowWorkerGroups = useMemo(
- () => workerGroups.filter((group) => group.scope === WorkerGroupScope.FLOW),
- [workerGroups],
- );
-
- const columns = useMemo(
- () => buildColumns({ workerGroups: flowWorkerGroups }),
- [flowWorkerGroups],
- );
-
- const handleProjectChange = (projectId: string) => {
- setSearchParams(
- (prev) => {
- const next = new URLSearchParams(prev);
- next.set(FLOW_PROJECT_QUERY_PARAM, projectId);
- next.delete('cursor');
- return next;
- },
- { replace: true },
- );
- };
-
- const projectSelector = (
- <Select value={selectedProjectId} onValueChange={handleProjectChange}>
- <SelectTrigger className="w-[240px]">
- <SelectValue placeholder={t('Select a project')} />
- </SelectTrigger>
- <SelectContent>
- {projects.map((project) => (
- <SelectItem key={project.id} value={project.id}>
- <div className="flex items-center gap-2 min-w-0">
- <ProjectAvatar project={project} />
- <span className="truncate">{project.displayName}</span>
- </div>
- </SelectItem>
- ))}
- </SelectContent>
- </Select>
- );
-
- const searchBar = (
- <div className="relative">
- <Search className="absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-gray-11" />
- <Input
- className="pl-8 w-[240px]"
- placeholder={t('Search flows')}
- defaultValue={flowName ?? ''}
- onChange={(e) => {
- const value = e.target.value;
- setSearchParams(
- (prev) => {
- const next = new URLSearchParams(prev);
- if (value) {
- next.set(FLOW_NAME_QUERY_PARAM, value);
- } else {
- next.delete(FLOW_NAME_QUERY_PARAM);
- }
- next.delete('cursor');
- return next;
- },
- { replace: true },
- );
- }}
- />
- </div>
- );
-
- if (isNil(defaultProject)) {
- return (
- <div className="flex flex-col items-center justify-center py-16 gap-3 text-gray-11">
- <Workflow className="size-10" strokeWidth={1.5} />
- <p className="text-sm">{t('No projects')}</p>
- </div>
- );
- }
-
- return (
- <div className="flex flex-col gap-3">
- <p className="flex items-center gap-2 text-sm text-gray-11">
- <Workflow className="size-4 shrink-0" />
- {t(
- 'Pin a single flow to a worker group. Flows without a pin follow their project assignment.',
- )}
- </p>
-
- <DataTable
- columns={columns}
- page={page}
- isLoading={isLoading}
- isError={isError}
- errorStateEntity={t('flows')}
- onRetry={refetch}
- emptyStateTextTitle={t('No flows yet')}
- emptyStateTextDescription={t(
- 'Flows created in this project will show up here',
- )}
- emptyStateIcon={<Workflow className="size-14" />}
- toolbarButtons={[projectSelector, searchBar]}
- />
- </div>
- );
-}
-
-function useProjectFlowsPage({
- projectId,
- cursor,
- limit,
- name,
-}: {
- projectId: string | undefined;
- cursor: string | undefined;
- limit: string;
- name: string | undefined;
-}) {
- return useQuery<SeekPage<PopulatedFlow>>({
- queryKey: ['worker-groups-flows', projectId, cursor, limit, name],
- queryFn: () =>
- api.get<SeekPage<PopulatedFlow>>('/v1/flows', {
- projectId,
- cursor,
- limit: Number(limit) || 10,
- name,
- }),
- enabled: !isNil(projectId),
- });
-}
-
-function buildColumns({ workerGroups }: { workerGroups: WorkerGroupInfo[] }) {
- return [
- {
- accessorKey: 'version.displayName',
- header: () => t('Flow'),
- cell: ({
- row,
- }: {
- row: { original: RowDataWithActions<PopulatedFlow> };
- }) => (
- <div className="flex items-center gap-2.5 min-w-0">
- <Workflow className="size-4 shrink-0 text-gray-11" />
- <TextWithTooltip tooltipMessage={row.original.version.displayName}>
- <p className="text-sm font-medium truncate">
- {row.original.version.displayName}
- </p>
- </TextWithTooltip>
- </div>
- ),
- },
- {
- accessorKey: 'status',
- header: () => t('Status'),
- size: 100,
- cell: ({
- row,
- }: {
- row: { original: RowDataWithActions<PopulatedFlow> };
- }) => (
- <span className="text-sm text-gray-11">
- {row.original.status === FlowStatus.ENABLED
- ? t('Enabled')
- : t('Disabled')}
- </span>
- ),
- },
- {
- accessorKey: 'workerGroupId',
- header: () => t('Assigned worker'),
- size: 240,
- cell: ({
- row,
- }: {
- row: { original: RowDataWithActions<PopulatedFlow> };
- }) => (
- <FlowWorkerGroupCell row={row.original} workerGroups={workerGroups} />
- ),
- },
- ];
-}
-
-function FlowWorkerGroupCell({
- row,
- workerGroups,
-}: {
- row: RowDataWithActions<PopulatedFlow>;
- workerGroups: WorkerGroupInfo[];
-}) {
- const selectValue = row.workerGroupId ?? DEFAULT_SENTINEL;
- const isDefault = selectValue === DEFAULT_SENTINEL;
- const isOffline =
- !isNil(row.workerGroupId) &&
- !workerGroups.some((info) => info.label === row.workerGroupId);
-
- const handleChange = async (value: string) => {
- const workerGroupId = value === DEFAULT_SENTINEL ? null : value;
- try {
- await workersApi.assignFlow(row.id, workerGroupId);
- row.update({ workerGroupId });
- toast.success(t('Saved'));
- } catch {
- toast.error(t('Failed to save'));
- }
- };
-
- return (
- <div className="flex flex-col gap-1">
- <Select value={selectValue} onValueChange={handleChange}>
- <SelectTrigger
- className={cn('w-[200px]', isOffline && 'border-danger-9')}
- >
- <div className="flex items-center gap-2 min-w-0">
- <Cpu
- className={cn(
- 'size-3.5 shrink-0',
- isOffline
- ? 'text-danger-11'
- : isDefault
- ? 'text-gray-11'
- : 'text-accent-11',
- )}
- />
- <SelectValue />
- </div>
- </SelectTrigger>
- <SelectContent>
- <SelectItem value={DEFAULT_SENTINEL}>
- <span className="text-gray-11">{t('Default')}</span>
- </SelectItem>
- {isOffline && (
- <SelectItem value={row.workerGroupId!}>
- {row.workerGroupId!.replaceAll('_', ' ')}
- </SelectItem>
- )}
- {workerGroups.map((info) => (
- <SelectItem key={info.label} value={info.label}>
- {info.label.replaceAll('_', ' ')}
- </SelectItem>
- ))}
- </SelectContent>
- </Select>
- {isOffline && (
- <p className="text-xs text-danger-11">
- {t('{group} has no workers online. Runs will wait in its queue', {
- group: row.workerGroupId!.replaceAll('_', ' '),
- })}
- </p>
- )}
- </div>
- );
-}
-
-type ByFlowViewProps = {
- projects: ProjectWithLimits[];
- workerGroups: WorkerGroupInfo[];
-};
diff --git a/packages/web/src/app/routes/platform/infra/workers/by-group-view.tsx b/packages/web/src/app/routes/platform/infra/workers/by-group-view.tsx
deleted file mode 100644
index 5ab0d5d56fc..00000000000
--- a/packages/web/src/app/routes/platform/infra/workers/by-group-view.tsx
+++ /dev/null
@@ -1,290 +0,0 @@
-import {
- ProjectWithLimits,
- WorkerGroupScope,
- WorkerMachineWithStatus,
-} from '@activepieces/shared';
-import { useQuery } from '@tanstack/react-query';
-import { t } from 'i18next';
-import { Layers, Plus, Workflow } from 'lucide-react';
-import { useState } from 'react';
-
-import { AdminEmpty, adminSurface } from '@/app/components/admin';
-import { DataFetchErrorState } from '@/components/custom/data-fetch-error-state';
-import { TextWithTooltip } from '@/components/custom/text-with-tooltip';
-import { Button } from '@/components/ui/button';
-import {
- WorkerGroupFlow,
- WorkerGroupFlows,
- WorkerGroupInfo,
- workersApi,
-} from '@/features/platform-admin/api/workers-api';
-import { AdminControl, adminControl } from '@/lib/admin-control';
-import { cn } from '@/lib/utils';
-
-import { AssignFlowsDialog } from './assign-flows-dialog';
-import { AssignProjectsDialog } from './assign-projects-dialog';
-import { ProjectAvatar } from './project-avatar';
-
-export function ByGroupView({
- projects,
- workerGroups,
- workers,
-}: ByGroupViewProps) {
- const liveProjectGroups = workerGroups
- .filter((g) => g.scope === WorkerGroupScope.PROJECT)
- .map((g) => g.label);
- const groupsFromProjects = projects
- .map((p) => p.workerGroupId)
- .filter((id): id is string => id != null);
- const projectGroupLabels = Array.from(
- new Set([...liveProjectGroups, ...groupsFromProjects]),
- ).sort();
-
- const flowGroupLabels = Array.from(
- new Set(
- workerGroups
- .filter((g) => g.scope === WorkerGroupScope.FLOW)
- .map((g) => g.label),
- ),
- ).sort();
-
- if (projectGroupLabels.length === 0 && flowGroupLabels.length === 0) {
- return <AdminEmpty icon={<Layers />} title={t('No worker groups')} />;
- }
-
- return (
- <div className="flex flex-col gap-6">
- {projectGroupLabels.length > 0 && (
- <section className="flex flex-col gap-3">
- <span className="text-xs font-medium uppercase tracking-wide text-gray-11">
- {t('Project worker groups')}
- </span>
- <div className="flex flex-wrap gap-4">
- {projectGroupLabels.map((label) => (
- <GroupCard
- key={label}
- groupLabel={label}
- scope={WorkerGroupScope.PROJECT}
- allProjects={projects}
- workers={workers}
- />
- ))}
- </div>
- </section>
- )}
-
- {flowGroupLabels.length > 0 && (
- <section className="flex flex-col gap-3">
- <span className="text-xs font-medium uppercase tracking-wide text-gray-11">
- {t('Flow worker groups')}
- </span>
- <div className="flex flex-wrap gap-4">
- {flowGroupLabels.map((label) => (
- <GroupCard
- key={label}
- groupLabel={label}
- scope={WorkerGroupScope.FLOW}
- allProjects={projects}
- workers={workers}
- />
- ))}
- </div>
- </section>
- )}
- </div>
- );
-}
-
-function GroupCard({
- groupLabel,
- scope,
- allProjects,
- workers,
-}: GroupCardProps) {
- const [dialogOpen, setDialogOpen] = useState(false);
- const isFlowGroup = scope === WorkerGroupScope.FLOW;
-
- const assignedProjects = allProjects.filter(
- (p) => p.workerGroupId === groupLabel,
- );
-
- const groupWorkers = workers.filter(
- (w) => w.workerGroupScope === scope && w.workerGroupId === groupLabel,
- );
- const onlineWorkerCount = groupWorkers.length;
- const totalSlots = groupWorkers.reduce((sum, worker) => {
- const parsed = Number(worker.information.workerProps.WORKER_CONCURRENCY);
- return sum + (Number.isInteger(parsed) && parsed > 0 ? parsed : 1);
- }, 0);
-
- return (
- <>
- <div
- className={cn(
- adminSurface.card,
- 'flex w-full flex-col gap-4 p-5 sm:w-[475px]',
- )}
- >
- <div className="flex min-w-0 items-center gap-2">
- <div className="flex size-7 shrink-0 items-center justify-center rounded-lg bg-accent-3 text-accent-11">
- {isFlowGroup ? (
- <Workflow className="size-4" />
- ) : (
- <Layers className="size-4" />
- )}
- </div>
- <TextWithTooltip tooltipMessage={groupLabel}>
- <span className="text-sm font-semibold truncate min-w-0">
- {groupLabel.replaceAll('_', ' ')}
- </span>
- </TextWithTooltip>
- </div>
-
- <div className="flex items-baseline gap-2">
- <span className="text-2xl font-semibold text-gray-12">
- {onlineWorkerCount}
- </span>
- <span className="text-sm text-gray-11">
- {t('{count, plural, =1 {worker} other {workers}}', {
- count: onlineWorkerCount,
- })}{' '}
- | {t('{count} total concurrencies', { count: totalSlots })}
- </span>
- </div>
-
- {isFlowGroup ? (
- <div className="flex flex-col gap-2 border-t pt-4">
- <div className="flex items-center justify-between">
- <span className="text-xs font-medium text-gray-11">
- {t('Flows')}
- </span>
- <Button
- {...adminControl(AdminControl.WORKERS_ASSIGN_OPEN)}
- variant="ghost"
- size="xs"
- onClick={() => setDialogOpen(true)}
- >
- <Plus className="size-3.5" />
- {t('Assign')}
- </Button>
- </div>
- <AssignedFlowChips groupLabel={groupLabel} />
- </div>
- ) : (
- <div className="flex flex-col gap-2 border-t pt-4">
- <div className="flex items-center justify-between">
- <span className="text-xs font-medium text-gray-11">
- {t('Projects')}
- </span>
- <Button
- {...adminControl(AdminControl.WORKERS_ASSIGN_OPEN)}
- variant="ghost"
- size="xs"
- onClick={() => setDialogOpen(true)}
- >
- <Plus className="size-3.5" />
- {t('Assign')}
- </Button>
- </div>
-
- {assignedProjects.length === 0 ? (
- <p className="text-xs text-gray-11">{t('No projects')}</p>
- ) : (
- <div className="flex flex-wrap items-center gap-2">
- {assignedProjects.slice(0, 3).map((project) => (
- <ProjectChip key={project.id} project={project} />
- ))}
- {assignedProjects.length > 3 && (
- <span className="text-xs text-gray-11">
- {t('+{count} more', { count: assignedProjects.length - 3 })}
- </span>
- )}
- </div>
- )}
- </div>
- )}
- </div>
-
- {isFlowGroup ? (
- <AssignFlowsDialog
- open={dialogOpen}
- onOpenChange={setDialogOpen}
- groupLabel={groupLabel}
- allProjects={allProjects}
- />
- ) : (
- <AssignProjectsDialog
- open={dialogOpen}
- onOpenChange={setDialogOpen}
- groupLabel={groupLabel}
- allProjects={allProjects}
- />
- )}
- </>
- );
-}
-
-function AssignedFlowChips({ groupLabel }: { groupLabel: string }) {
- const { data, isError, refetch } = useQuery<WorkerGroupFlows>({
- queryKey: ['worker-group-assigned-flows', groupLabel],
- queryFn: () => workersApi.listGroupFlows(groupLabel),
- });
- const flows = data?.flows ?? [];
- const total = data?.total ?? 0;
-
- if (isError) {
- return <DataFetchErrorState entity={t('flows')} onRetry={refetch} />;
- }
-
- if (flows.length === 0) {
- return <p className="text-xs text-gray-11">{t('No flows')}</p>;
- }
-
- return (
- <div className="flex flex-wrap items-center gap-2">
- {flows.slice(0, 3).map((flow) => (
- <FlowChip key={flow.id} flow={flow} />
- ))}
- {total > 3 && (
- <span className="text-xs text-gray-11">
- {t('+{count} more', { count: total - 3 })}
- </span>
- )}
- </div>
- );
-}
-
-function FlowChip({ flow }: { flow: WorkerGroupFlow }) {
- return (
- <div className="inline-flex items-center gap-1 rounded-md border bg-gray-3/40 px-2 py-0.5 text-xs">
- <Workflow className="size-3 shrink-0 text-gray-11" />
- <TextWithTooltip tooltipMessage={flow.displayName}>
- <span className="max-w-[100px] truncate">{flow.displayName}</span>
- </TextWithTooltip>
- </div>
- );
-}
-
-function ProjectChip({ project }: { project: ProjectWithLimits }) {
- return (
- <div className="inline-flex items-center gap-1 rounded-md border bg-gray-3/40 px-2 py-0.5 text-xs">
- <ProjectAvatar project={project} size="sm" />
- <TextWithTooltip tooltipMessage={project.displayName}>
- <span className="max-w-[100px] truncate">{project.displayName}</span>
- </TextWithTooltip>
- </div>
- );
-}
-
-type ByGroupViewProps = {
- projects: ProjectWithLimits[];
- workerGroups: WorkerGroupInfo[];
- workers: WorkerMachineWithStatus[];
-};
-
-type GroupCardProps = {
- groupLabel: string;
- scope: WorkerGroupScope;
- allProjects: ProjectWithLimits[];
- workers: WorkerMachineWithStatus[];
-};
diff --git a/packages/web/src/app/routes/platform/infra/workers/by-project-view.tsx b/packages/web/src/app/routes/platform/infra/workers/by-project-view.tsx
deleted file mode 100644
index 071eaf1c871..00000000000
--- a/packages/web/src/app/routes/platform/infra/workers/by-project-view.tsx
+++ /dev/null
@@ -1,398 +0,0 @@
-import {
- isNil,
- SeekPage,
- UpdateProjectPlatformRequest,
- ProjectWithLimits,
- WorkerGroupScope,
-} from '@activepieces/shared';
-import { useQuery, useQueryClient } from '@tanstack/react-query';
-import { t } from 'i18next';
-import { BarChart3, Cpu, Search, Server } from 'lucide-react';
-import React, { useMemo, useState } from 'react';
-import { useSearchParams } from 'react-router-dom';
-import { toast } from 'sonner';
-
-import { AdminDataTable } from '@/app/components/admin';
-import { RowDataWithActions } from '@/components/custom/data-table';
-import { TextWithTooltip } from '@/components/custom/text-with-tooltip';
-import { Input } from '@/components/ui/input';
-import {
- Select,
- SelectContent,
- SelectItem,
- SelectTrigger,
- SelectValue,
-} from '@/components/ui/select';
-import { WorkerGroupInfo } from '@/features/platform-admin/api/workers-api';
-import { api } from '@/lib/api';
-import { cn } from '@/lib/utils';
-
-import { ProjectAvatar } from './project-avatar';
-
-const SHARED_SENTINEL = '__shared__';
-
-type ByProjectViewProps = {
- workerGroups: WorkerGroupInfo[];
- sharedSlots: number;
-};
-
-export function ByProjectView({
- workerGroups,
- sharedSlots,
-}: ByProjectViewProps) {
- const [searchParams, setSearchParams] = useSearchParams();
- const cursor = searchParams.get('cursor') ?? undefined;
- const limit = searchParams.get('limit') ?? '10';
- const displayName = searchParams.get('displayName') ?? undefined;
-
- const queryClient = useQueryClient();
-
- const {
- data: page,
- isLoading,
- isError,
- refetch,
- } = usePlatformProjectsPage({
- cursor,
- limit,
- displayName,
- });
-
- const projectWorkerGroups = useMemo(
- () =>
- workerGroups.filter((group) => group.scope === WorkerGroupScope.PROJECT),
- [workerGroups],
- );
-
- const columns = useMemo(
- () =>
- buildColumns({
- workerGroups: projectWorkerGroups,
- sharedSlots,
- queryClient,
- }),
- [projectWorkerGroups, sharedSlots, queryClient],
- );
-
- const searchBar = (
- <div className="relative">
- <Search className="absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-gray-11" />
- <Input
- size="sm"
- className="w-60 pl-8"
- placeholder={t('Search projects')}
- defaultValue={displayName ?? ''}
- onChange={(e) => {
- const value = e.target.value;
- setSearchParams(
- (prev) => {
- const next = new URLSearchParams(prev);
- if (value) {
- next.set('displayName', value);
- } else {
- next.delete('displayName');
- }
- next.delete('cursor');
- return next;
- },
- { replace: true },
- );
- }}
- />
- </div>
- );
-
- return (
- <div className="flex flex-col gap-4">
- <p className="flex items-center gap-2 text-sm text-gray-11">
- <BarChart3 className="size-4 shrink-0" />
- {t(
- 'Allocate capacity per project — pick its worker group and concurrency limit. Leave the limit empty to inherit the platform default. Project settings shows these read-only and links here.',
- )}
- </p>
-
- <AdminDataTable
- columns={columns}
- page={page}
- isLoading={isLoading}
- isError={isError}
- errorStateEntity={t('projects')}
- onRetry={refetch}
- emptyStateTextTitle={t('No projects yet')}
- emptyStateTextDescription={t(
- 'Start by creating projects to manage your automation teams',
- )}
- emptyStateIcon={<Server />}
- toolbarButtons={[searchBar]}
- />
- </div>
- );
-}
-
-function usePlatformProjectsPage({
- cursor,
- limit,
- displayName,
-}: {
- cursor: string | undefined;
- limit: string;
- displayName: string | undefined;
-}) {
- return useQuery<SeekPage<ProjectWithLimits>>({
- queryKey: ['platform-projects-page', cursor, limit, displayName],
- queryFn: () =>
- api.get<SeekPage<ProjectWithLimits>>('/v1/projects', {
- cursor,
- limit: Number(limit) || 10,
- displayName,
- }),
- });
-}
-
-function buildColumns({
- workerGroups,
- sharedSlots,
- queryClient,
-}: {
- workerGroups: WorkerGroupInfo[];
- sharedSlots: number;
- queryClient: ReturnType<typeof useQueryClient>;
-}) {
- return [
- {
- accessorKey: 'displayName',
- header: () => t('Project'),
- cell: ({
- row,
- }: {
- row: { original: RowDataWithActions<ProjectWithLimits> };
- }) => (
- <div className="flex min-w-0 items-center gap-2">
- <ProjectAvatar project={row.original} />
- <TextWithTooltip tooltipMessage={row.original.displayName}>
- <p className="text-sm font-medium truncate">
- {row.original.displayName}
- </p>
- </TextWithTooltip>
- </div>
- ),
- },
- {
- accessorKey: 'analytics.totalFlows',
- header: () => t('Flows'),
- size: 100,
- cell: ({
- row,
- }: {
- row: { original: RowDataWithActions<ProjectWithLimits> };
- }) => (
- <span className="text-sm text-gray-11">
- {row.original.analytics.totalFlows}
- </span>
- ),
- },
- {
- accessorKey: 'workerGroupId',
- header: () => t('Assigned worker'),
- size: 240,
- cell: ({
- row,
- }: {
- row: { original: RowDataWithActions<ProjectWithLimits> };
- }) => (
- <WorkerGroupCell
- row={row.original}
- workerGroups={workerGroups}
- queryClient={queryClient}
- />
- ),
- },
- {
- accessorKey: 'maxConcurrentJobs',
- header: () => t('Concurrency limit'),
- size: 200,
- cell: ({
- row,
- }: {
- row: { original: RowDataWithActions<ProjectWithLimits> };
- }) => (
- <ConcurrencyCell
- row={row.original}
- workerGroups={workerGroups}
- sharedSlots={sharedSlots}
- queryClient={queryClient}
- />
- ),
- },
- ];
-}
-
-function WorkerGroupCell({
- row,
- workerGroups,
- queryClient,
-}: {
- row: RowDataWithActions<ProjectWithLimits>;
- workerGroups: WorkerGroupInfo[];
- queryClient: ReturnType<typeof useQueryClient>;
-}) {
- const selectValue = row.workerGroupId ?? SHARED_SENTINEL;
- const isShared = selectValue === SHARED_SENTINEL;
- const isOffline =
- !isNil(row.workerGroupId) &&
- !workerGroups.some((info) => info.label === row.workerGroupId);
-
- const handleChange = async (value: string) => {
- const workerGroupId = value === SHARED_SENTINEL ? null : value;
- const result = await saveProjectUpdate({
- projectId: row.id!,
- update: { workerGroupId },
- });
- if (result.success) {
- row.update({ workerGroupId });
- queryClient.invalidateQueries({ queryKey: ['projects'] });
- toast.success(t('Saved'));
- } else {
- toast.error(t('Failed to save'));
- }
- };
-
- return (
- <div className="flex flex-col gap-1">
- <Select value={selectValue} onValueChange={handleChange}>
- <SelectTrigger
- size="sm"
- className={cn('w-50', isOffline && 'border-danger-9')}
- >
- <div className="flex items-center gap-2 min-w-0">
- <Cpu
- className={cn(
- 'size-3.5 shrink-0',
- isOffline
- ? 'text-danger-11'
- : isShared
- ? 'text-gray-11'
- : 'text-accent-11',
- )}
- />
- <SelectValue />
- </div>
- </SelectTrigger>
- <SelectContent>
- <SelectItem value={SHARED_SENTINEL}>
- <span className="text-gray-11">{t('Shared')}</span>
- </SelectItem>
- {isOffline && (
- <SelectItem value={row.workerGroupId!}>
- {row.workerGroupId!.replaceAll('_', ' ')}
- </SelectItem>
- )}
- {workerGroups.map((info) => (
- <SelectItem key={info.label} value={info.label}>
- {info.label.replaceAll('_', ' ')}
- </SelectItem>
- ))}
- </SelectContent>
- </Select>
- {isOffline && (
- <p className="text-xs text-danger-11">
- {t('{group} has no workers online. Runs will wait in its queue', {
- group: row.workerGroupId!.replaceAll('_', ' '),
- })}
- </p>
- )}
- </div>
- );
-}
-
-function ConcurrencyCell({
- row,
- workerGroups,
- sharedSlots,
- queryClient,
-}: {
- row: RowDataWithActions<ProjectWithLimits>;
- workerGroups: WorkerGroupInfo[];
- sharedSlots: number;
- queryClient: ReturnType<typeof useQueryClient>;
-}) {
- const assignedGroup = workerGroups.find(
- (info) => info.label === row.workerGroupId,
- );
- const poolSlots = assignedGroup ? assignedGroup.slots : sharedSlots;
- const concurrencyPlaceholder = t('Default {count}', { count: poolSlots });
-
- const [concurrencyInput, setConcurrencyInput] = useState(
- row.maxConcurrentJobs != null ? String(row.maxConcurrentJobs) : '',
- );
-
- const commitConcurrency = async () => {
- const parsed =
- concurrencyInput.trim() === '' ? null : parseInt(concurrencyInput, 10);
- if (parsed !== null && (isNaN(parsed) || parsed <= 0)) {
- toast.error(t('Concurrency limit must be a positive number'));
- setConcurrencyInput(
- row.maxConcurrentJobs != null ? String(row.maxConcurrentJobs) : '',
- );
- return;
- }
- const result = await saveProjectUpdate({
- projectId: row.id!,
- update: { maxConcurrentJobs: parsed },
- });
- if (result.success) {
- row.update({ maxConcurrentJobs: parsed });
- queryClient.invalidateQueries({ queryKey: ['projects'] });
- toast.success(t('Saved'));
- } else {
- toast.error(t('Failed to save'));
- }
- };
-
- const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {
- if (e.key === 'Enter') {
- e.currentTarget.blur();
- }
- };
-
- const handleChange = (value: string) => {
- const digits = value.replace(/[^0-9]/g, '');
- if (digits === '') {
- setConcurrencyInput('');
- return;
- }
- const parsed = parseInt(digits, 10);
- const capped = poolSlots > 0 ? Math.min(parsed, poolSlots) : parsed;
- setConcurrencyInput(String(capped));
- };
-
- return (
- <Input
- type="text"
- inputMode="numeric"
- size="sm"
- max={poolSlots > 0 ? poolSlots : undefined}
- className="w-36"
- placeholder={concurrencyPlaceholder}
- value={concurrencyInput}
- onChange={(e) => handleChange(e.target.value)}
- onBlur={commitConcurrency}
- onKeyDown={handleKeyDown}
- />
- );
-}
-
-async function saveProjectUpdate({
- projectId,
- update,
-}: {
- projectId: string;
- update: UpdateProjectPlatformRequest;
-}): Promise<{ success: boolean }> {
- try {
- await api.post<ProjectWithLimits>(`/v1/projects/${projectId}`, update);
- return { success: true };
- } catch {
- return { success: false };
- }
-}
diff --git a/packages/web/src/app/routes/platform/infra/workers/index.tsx b/packages/web/src/app/routes/platform/infra/workers/index.tsx
index 920e2a8a394..28bb0b8273b 100644
--- a/packages/web/src/app/routes/platform/infra/workers/index.tsx
+++ b/packages/web/src/app/routes/platform/infra/workers/index.tsx
@@ -44,8 +44,8 @@ import { useTimeAgo } from '@/hooks/use-time-ago';
import { cn } from '@/lib/utils';
import { SandboxesPopover } from './sandboxes-popover';
-import { WorkerAssignmentsTab } from './worker-assignments-tab';
import { WorkerConfigsPopover } from './worker-configs-popover';
+import { WorkerGroupsPage } from './worker-groups/worker-groups-page';
export default function WorkersPage({ section }: WorkersPageProps) {
const { data: edition } = flagsHooks.useFlag<ApEdition>(ApFlagId.EDITION);
@@ -55,6 +55,22 @@ export default function WorkersPage({ section }: WorkersPageProps) {
const fleetType = workersData?.[0]?.type;
+ if (section === 'worker-groups') {
+ return (
+ <LockedFeatureGuard
+ featureKey="DEDICATED_WORKERS"
+ locked={!platform.plan.workerGroupsEnabled}
+ lockTitle={t('Unlock worker groups')}
+ lockDescription={t(
+ 'Set aside servers for specific projects or flows, so a busy project never slows down the rest.',
+ )}
+ lockDocumentationUrl="https://www.activepieces.com/docs/install/configure-operate/worker-groups"
+ >
+ <WorkerGroupsPage />
+ </LockedFeatureGuard>
+ );
+ }
+
return (
<AdminPage>
<AdminPageHeader
@@ -139,20 +155,6 @@ export default function WorkersPage({ section }: WorkersPageProps) {
))}
</div>
)}
-
- {section === 'worker-groups' && (
- <LockedFeatureGuard
- featureKey="DEDICATED_WORKERS"
- locked={!platform.plan.workerGroupsEnabled}
- lockTitle={t('Unlock Worker Groups')}
- lockDescription={t(
- 'Reserve dedicated worker capacity for specific projects so a busy project never slows down the rest',
- )}
- lockDocumentationUrl="https://www.activepieces.com/docs/install/configure-operate/worker-groups"
- >
- <WorkerAssignmentsTab />
- </LockedFeatureGuard>
- )}
</AdminPage>
);
}
diff --git a/packages/web/src/app/routes/platform/infra/workers/project-avatar.tsx b/packages/web/src/app/routes/platform/infra/workers/project-avatar.tsx
deleted file mode 100644
index c4c2ad82eaa..00000000000
--- a/packages/web/src/app/routes/platform/infra/workers/project-avatar.tsx
+++ /dev/null
@@ -1,33 +0,0 @@
-import {
- PROJECT_COLOR_PALETTE,
- ProjectType,
- ProjectWithLimits,
-} from '@activepieces/shared';
-
-import { cn } from '@/lib/utils';
-
-export function ProjectAvatar({ project, size = 'md' }: ProjectAvatarProps) {
- const isPersonal = project.type === ProjectType.PERSONAL;
- const palette = PROJECT_COLOR_PALETTE[project.icon.color];
- const background = isPersonal ? 'var(--gray-9)' : palette.color;
- const color = isPersonal ? 'var(--gray-1)' : palette.textColor;
-
- const sizeClass = size === 'sm' ? 'size-5 text-xs' : 'size-7 text-xs';
-
- return (
- <div
- className={cn(
- 'flex shrink-0 items-center justify-center rounded-md font-semibold',
- sizeClass,
- )}
- style={{ backgroundColor: background, color }}
- >
- {project.displayName.charAt(0).toUpperCase()}
- </div>
- );
-}
-
-type ProjectAvatarProps = {
- project: ProjectWithLimits;
- size?: 'sm' | 'md';
-};
diff --git a/packages/web/src/app/routes/platform/infra/workers/worker-assignments-tab.tsx b/packages/web/src/app/routes/platform/infra/workers/worker-assignments-tab.tsx
deleted file mode 100644
index 3d8a877795d..00000000000
--- a/packages/web/src/app/routes/platform/infra/workers/worker-assignments-tab.tsx
+++ /dev/null
@@ -1,80 +0,0 @@
-import { t } from 'i18next';
-import { Info } from 'lucide-react';
-
-import { Alert, AlertDescription } from '@/components/ui/alert';
-import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs';
-import { workersQueries } from '@/features/platform-admin';
-import { projectCollectionUtils } from '@/features/projects/stores/project-collection';
-import { platformHooks } from '@/hooks/platform-hooks';
-import { AdminControl, adminControl } from '@/lib/admin-control';
-
-import { ByFlowView } from './by-flow-view';
-import { ByGroupView } from './by-group-view';
-import { ByProjectView } from './by-project-view';
-
-export function WorkerAssignmentsTab() {
- const { platform } = platformHooks.useCurrentPlatform();
- const { data: projects } = projectCollectionUtils.useAllPlatformProjects();
- const { data: capacity } = workersQueries.useWorkerGroups(
- platform.plan.workerGroupsEnabled,
- );
- const { data: workersData } = workersQueries.useWorkerMachines();
-
- const workerGroups = capacity?.groups ?? [];
- const sharedSlots = capacity?.sharedSlots ?? 0;
- const workers = workersData ?? [];
-
- return (
- <>
- <Alert variant="primary">
- <Info className="size-4" />
- <AlertDescription>
- {t(
- 'Worker groups reserve a dedicated queue for the projects you assign. Defined in your deployment with AP_WORKER_GROUP_ID.',
- )}{' '}
- <a
- {...adminControl(AdminControl.WORKERS_DOCS_LINK)}
- href="https://www.activepieces.com/docs/install/configure-operate/worker-groups"
- target="_blank"
- rel="noreferrer"
- >
- {t('Learn more')}
- </a>
- </AlertDescription>
- </Alert>
-
- <Tabs defaultValue="by-project" className="w-full">
- <TabsList variant="default">
- <TabsTrigger variant="default" value="by-project">
- {t('By project')}
- </TabsTrigger>
- <TabsTrigger variant="default" value="by-flow">
- {t('By flow')}
- </TabsTrigger>
- <TabsTrigger variant="default" value="by-group">
- {t('By group')}
- </TabsTrigger>
- </TabsList>
-
- <TabsContent value="by-project">
- <ByProjectView
- workerGroups={workerGroups}
- sharedSlots={sharedSlots}
- />
- </TabsContent>
-
- <TabsContent value="by-flow">
- <ByFlowView projects={projects} workerGroups={workerGroups} />
- </TabsContent>
-
- <TabsContent value="by-group">
- <ByGroupView
- projects={projects}
- workerGroups={workerGroups}
- workers={workers}
- />
- </TabsContent>
- </Tabs>
- </>
- );
-}
diff --git a/packages/web/src/app/routes/platform/infra/workers/worker-groups/add-items-dialog.tsx b/packages/web/src/app/routes/platform/infra/workers/worker-groups/add-items-dialog.tsx
new file mode 100644
index 00000000000..c3d51305ce3
--- /dev/null
+++ b/packages/web/src/app/routes/platform/infra/workers/worker-groups/add-items-dialog.tsx
@@ -0,0 +1,442 @@
+import {
+ WorkerGroupProjectAssignment,
+ WorkerGroupsOverview,
+} from '@activepieces/shared';
+import { t } from 'i18next';
+import { Check, ChevronDown } from 'lucide-react';
+import React, { useState } from 'react';
+
+import { adminLayout, adminSurface } from '@/app/components/admin';
+import { DataFetchErrorState } from '@/components/custom/data-fetch-error-state';
+import { Button } from '@/components/ui/button';
+import { Checkbox } from '@/components/ui/checkbox';
+import {
+ Command,
+ CommandGroup,
+ CommandInput,
+ CommandItem,
+ CommandList,
+} from '@/components/ui/command';
+import {
+ Dialog,
+ DialogContent,
+ DialogDescription,
+ DialogFooter,
+ DialogHeader,
+ DialogTitle,
+} from '@/components/ui/dialog';
+import {
+ Popover,
+ PopoverContent,
+ PopoverTrigger,
+} from '@/components/ui/popover';
+import { Skeleton } from '@/components/ui/skeleton';
+import { AdminControl, adminControl } from '@/lib/admin-control';
+import { cn } from '@/lib/utils';
+
+import {
+ MoveItem,
+ PAGE_SIZE,
+ groupUtils,
+ useDebounced,
+ useMover,
+ workerGroupsQueries,
+} from './hooks';
+import { FlowBadge, OffBadge, ProjectBadge, SearchBox } from './parts';
+
+export function AddItemsDialog({
+ open,
+ onOpenChange,
+ overview,
+ label,
+ kind,
+}: {
+ open: boolean;
+ onOpenChange: (open: boolean) => void;
+ overview: WorkerGroupsOverview | undefined;
+ label: string;
+ kind: 'project' | 'flow';
+}) {
+ return (
+ <Dialog open={open} onOpenChange={onOpenChange}>
+ <DialogContent className={adminLayout.dialog.lg}>
+ {open && (
+ <AddItemsForm
+ overview={overview}
+ label={label}
+ kind={kind}
+ onDone={() => onOpenChange(false)}
+ />
+ )}
+ </DialogContent>
+ </Dialog>
+ );
+}
+
+function AddItemsForm({
+ overview,
+ label,
+ kind,
+ onDone,
+}: {
+ overview: WorkerGroupsOverview | undefined;
+ label: string;
+ kind: 'project' | 'flow';
+ onDone: () => void;
+}) {
+ const [search, setSearch] = useState('');
+ const [project, setProject] = useState<WorkerGroupProjectAssignment | null>(
+ null,
+ );
+ const [picked, setPicked] = useState<MoveItem[]>([]);
+ const { move } = useMover();
+ const [saving, setSaving] = useState(false);
+ const query = useDebounced({ value: search.trim(), ms: SEARCH_DEBOUNCE_MS });
+ const projects = workerGroupsQueries.useProjects({
+ params: {
+ filter: 'all',
+ search: query || undefined,
+ exclude: label,
+ },
+ enabled: kind === 'project',
+ });
+ const flows = workerGroupsQueries.useFlows({
+ params: {
+ limit: PAGE_SIZE,
+ filter: 'all',
+ projectId: project?.id,
+ search: query || undefined,
+ exclude: label,
+ },
+ enabled: kind === 'flow',
+ });
+ const group = groupUtils.find({ overview, label, scope: kind });
+ const pageQuery = kind === 'project' ? projects : flows;
+ const page = pageQuery.data;
+ const loadingRows = Math.min(
+ project ? project.flowCount : expectedRows({ overview, label, kind }),
+ VISIBLE_ROWS,
+ );
+ const rows =
+ kind === 'project'
+ ? (projects.data?.data ?? []).map((p) => ({
+ id: p.id,
+ name: p.displayName,
+ sub: null,
+ enabled: true,
+ icon: <ProjectBadge name={p.displayName} color={p.color} size="lg" />,
+ now: groupUtils.name(p.workerGroupId),
+ from: p.workerGroupId,
+ flows: p.flowCount - p.flowsElsewhere,
+ }))
+ : (flows.data?.data ?? []).map((f) => ({
+ id: f.id,
+ name: f.displayName,
+ sub: project ? null : f.projectName,
+ enabled: f.enabled,
+ icon: <FlowBadge size="lg" />,
+ now: groupUtils.name(f.effective),
+ from: f.workerGroupId,
+ flows: undefined,
+ }));
+ const toggle = (row: { id: string; from: string | null; flows?: number }) =>
+ setPicked((prev) =>
+ prev.some((i) => i.id === row.id)
+ ? prev.filter((i) => i.id !== row.id)
+ : [...prev, { kind, id: row.id, from: row.from, flows: row.flows }],
+ );
+ const addLabel =
+ picked.length === 0
+ ? kind === 'project'
+ ? t('Add projects')
+ : t('Add flows')
+ : kind === 'project'
+ ? t('Add {count, plural, =1 {1 project} other {# projects}}', {
+ count: picked.length,
+ })
+ : t('Add {count, plural, =1 {1 flow} other {# flows}}', {
+ count: picked.length,
+ });
+
+ return (
+ <>
+ <DialogHeader className="mb-0">
+ <DialogTitle className="pr-8">
+ {kind === 'project'
+ ? t('Add projects to {group}', {
+ group: groupUtils.name(label),
+ })
+ : t('Add flows to {group}', {
+ group: groupUtils.name(label),
+ })}
+ </DialogTitle>
+ <DialogDescription>
+ {kind === 'project'
+ ? t(
+ 'The projects you pick, and their flows, will run on this group.',
+ )
+ : t(
+ 'The flows you pick will run on this group instead of their project’s group.',
+ )}
+ </DialogDescription>
+ </DialogHeader>
+ <div className="flex flex-col gap-2 sm:flex-row">
+ <SearchBox
+ value={search}
+ onChange={setSearch}
+ placeholder={
+ kind === 'project' ? t('Search projects') : t('Search flows')
+ }
+ />
+ {kind === 'flow' && (
+ <ProjectFilter value={project} onChange={setProject} />
+ )}
+ </div>
+ <div
+ className={cn(
+ adminSurface.listFrame,
+ adminSurface.divider,
+ 'flex flex-col divide-y overflow-y-auto',
+ )}
+ style={{ height: Math.max(loadingRows, MIN_ROWS) * ROW_PX + 2 }}
+ >
+ {!page && pageQuery.isError && (
+ <DataFetchErrorState
+ entity={kind === 'project' ? t('projects') : t('flows')}
+ onRetry={() => pageQuery.refetch()}
+ />
+ )}
+ {!page &&
+ !pageQuery.isError &&
+ Array.from({ length: loadingRows }, (_, i) => (
+ <div key={i} className="flex h-12 shrink-0 items-center gap-3 px-3">
+ <Skeleton className="size-4 rounded" />
+ <Skeleton className="size-8 rounded-lg" />
+ <Skeleton className="h-4 w-48" />
+ <Skeleton className="ml-auto h-3 w-28" />
+ </div>
+ ))}
+ {rows.map((row) => (
+ <label
+ key={row.id}
+ className="flex h-12 shrink-0 cursor-pointer items-center gap-3 px-3 hover:bg-gray-2"
+ >
+ <Checkbox
+ checked={picked.some((i) => i.id === row.id)}
+ onCheckedChange={() => toggle(row)}
+ />
+ {row.icon}
+ <span className="flex min-w-0 flex-1 flex-col">
+ <span className="flex min-w-0 items-center gap-2">
+ <span
+ className={cn(
+ 'truncate text-sm',
+ row.enabled ? 'text-gray-12' : 'text-gray-10',
+ )}
+ >
+ {row.name}
+ </span>
+ {!row.enabled && <OffBadge />}
+ </span>
+ {row.sub && (
+ <span className="truncate text-xs text-gray-10">{row.sub}</span>
+ )}
+ </span>
+ <span className="w-48 shrink-0 truncate text-right text-xs text-gray-10 max-sm:hidden">
+ {t('Now on {group}', { group: row.now })}
+ </span>
+ </label>
+ ))}
+ {page && rows.length === 0 && (
+ <p className="flex flex-1 items-center justify-center p-6 text-center text-sm text-gray-10">
+ {search ? t('Nothing matches your search.') : t('Nothing to add.')}
+ </p>
+ )}
+ </div>
+ {group && group.online === 0 && (
+ <p className="text-sm text-gray-11">
+ {t(
+ 'This group has no workers online. Runs will wait until a worker is back.',
+ )}
+ </p>
+ )}
+ <DialogFooter className="mt-0 items-center sm:justify-between">
+ <span className="text-sm text-gray-11">
+ {[
+ t('{count} selected', { count: picked.length }),
+ page && page.total > page.data.length
+ ? t('first {shown} of {total} shown, search to find others', {
+ shown: page.data.length.toLocaleString(),
+ total: page.total.toLocaleString(),
+ })
+ : null,
+ ]
+ .filter(Boolean)
+ .join(' · ')}
+ </span>
+ <div className="flex gap-2">
+ <Button variant="outline" onClick={onDone}>
+ {t('Cancel')}
+ </Button>
+ <Button
+ {...adminControl(AdminControl.WORKERS_ASSIGN_SUBMIT)}
+ disabled={picked.length === 0}
+ loading={saving}
+ onClick={() => {
+ setSaving(true);
+ move({ items: picked, to: label })
+ .then((moved) => moved && onDone())
+ .catch(() => undefined)
+ .finally(() => setSaving(false));
+ }}
+ >
+ {addLabel}
+ </Button>
+ </div>
+ </DialogFooter>
+ </>
+ );
+}
+
+function ProjectFilter({
+ value,
+ onChange,
+}: {
+ value: WorkerGroupProjectAssignment | null;
+ onChange: (project: WorkerGroupProjectAssignment | null) => void;
+}) {
+ const [open, setOpen] = useState(false);
+ const [search, setSearch] = useState('');
+ const query = useDebounced({ value: search.trim(), ms: SEARCH_DEBOUNCE_MS });
+ const projects = workerGroupsQueries.useProjects({
+ params: { filter: 'all', search: query || undefined },
+ });
+ const pick = (next: WorkerGroupProjectAssignment | null) => {
+ onChange(next);
+ setOpen(false);
+ setSearch('');
+ };
+ return (
+ <Popover open={open} onOpenChange={setOpen}>
+ <PopoverTrigger asChild>
+ <Button
+ variant="outline"
+ className="w-full justify-between gap-3 font-normal sm:w-56"
+ >
+ <span className="flex min-w-0 items-center gap-2">
+ {value && (
+ <ProjectBadge name={value.displayName} color={value.color} />
+ )}
+ <span className={cn('truncate', !value && 'text-gray-11')}>
+ {value ? value.displayName : t('All projects')}
+ </span>
+ </span>
+ <ChevronDown className="size-4 shrink-0 text-gray-10" />
+ </Button>
+ </PopoverTrigger>
+ <PopoverContent
+ className="w-(--radix-popover-trigger-width) min-w-72 p-1"
+ align="end"
+ collisionPadding={16}
+ >
+ <Command shouldFilter={false}>
+ <CommandInput
+ placeholder={t('Find a project')}
+ value={search}
+ onValueChange={setSearch}
+ />
+ <CommandList className="max-h-[19.5rem] overflow-y-auto">
+ <CommandGroup>
+ {!search && (
+ <ProjectOption
+ value={ALL_PROJECTS_OPTION}
+ title={t('All projects')}
+ selected={value === null}
+ onSelect={() => pick(null)}
+ />
+ )}
+ {(projects.data?.data ?? []).map((p) => (
+ <ProjectOption
+ key={p.id}
+ value={p.id}
+ title={p.displayName}
+ badge={<ProjectBadge name={p.displayName} color={p.color} />}
+ selected={value?.id === p.id}
+ onSelect={() => pick(p)}
+ />
+ ))}
+ </CommandGroup>
+ {projects.data && projects.data.data.length === 0 && (
+ <p className="px-3 py-6 text-center text-sm text-gray-10">
+ {t('No projects match your search.')}
+ </p>
+ )}
+ {projects.data &&
+ projects.data.total > projects.data.data.length && (
+ <p className="border-t px-3 py-2 text-xs text-gray-10">
+ {t(
+ 'First {shown, number} of {total, number}. Type to narrow.',
+ {
+ shown: projects.data.data.length,
+ total: projects.data.total,
+ },
+ )}
+ </p>
+ )}
+ </CommandList>
+ </Command>
+ </PopoverContent>
+ </Popover>
+ );
+}
+
+function ProjectOption({
+ value,
+ title,
+ badge,
+ selected,
+ onSelect,
+}: {
+ value: string;
+ title: string;
+ badge?: React.ReactNode;
+ selected: boolean;
+ onSelect: () => void;
+}) {
+ return (
+ <CommandItem value={value} onSelect={onSelect} className="gap-2 py-2">
+ <Check
+ className={cn(
+ 'size-4 shrink-0',
+ selected ? 'opacity-100' : 'opacity-0',
+ )}
+ />
+ {badge}
+ <span className="flex-1 truncate">{title}</span>
+ </CommandItem>
+ );
+}
+
+function expectedRows({
+ overview,
+ label,
+ kind,
+}: {
+ overview: WorkerGroupsOverview | undefined;
+ label: string;
+ kind: 'project' | 'flow';
+}) {
+ if (!overview) return VISIBLE_ROWS;
+ const others = overview.groups.filter((g) => g.label !== label);
+ return kind === 'project'
+ ? overview.defaultGroup.projectCount +
+ others.reduce((sum, g) => sum + g.projectCount, 0)
+ : overview.defaultGroup.flowCount +
+ others.reduce((sum, g) => sum + g.flowCount, 0);
+}
+
+const SEARCH_DEBOUNCE_MS = 200;
+const ALL_PROJECTS_OPTION = '__all_projects__';
+const VISIBLE_ROWS = 8;
+const MIN_ROWS = 2;
+const ROW_PX = 48;
diff --git a/packages/web/src/app/routes/platform/infra/workers/worker-groups/api.ts b/packages/web/src/app/routes/platform/infra/workers/worker-groups/api.ts
new file mode 100644
index 00000000000..af5c67624a8
--- /dev/null
+++ b/packages/web/src/app/routes/platform/infra/workers/worker-groups/api.ts
@@ -0,0 +1,67 @@
+import {
+ AssignWorkerGroupFlowsRequest,
+ AssignWorkerGroupProjectsRequest,
+ ListWorkerGroupFlowsRequest,
+ ListWorkerGroupProjectsRequest,
+ MoveAllWorkerGroupRequest,
+ ProjectWithLimits,
+ WorkerGroupFlowAssignmentPage,
+ WorkerGroupMoveResult,
+ WorkerGroupProjectAssignmentPage,
+ WorkerGroupsOverview,
+} from '@activepieces/shared';
+
+import { api } from '@/lib/api';
+
+export const workerGroupsApi = {
+ overview() {
+ return api.get<WorkerGroupsOverview>('/v1/worker-groups/overview');
+ },
+ projects(params: ListParams<ListWorkerGroupProjectsRequest>) {
+ return api.get<WorkerGroupProjectAssignmentPage>(
+ '/v1/worker-groups/assignments/projects',
+ params,
+ );
+ },
+ flows(params: ListParams<ListWorkerGroupFlowsRequest>) {
+ return api.get<WorkerGroupFlowAssignmentPage>(
+ '/v1/worker-groups/assignments/flows',
+ params,
+ );
+ },
+ assignProjects(request: AssignWorkerGroupProjectsRequest) {
+ return api.post<WorkerGroupMoveResult>(
+ '/v1/worker-groups/assignments/projects',
+ request,
+ );
+ },
+ assignFlows(request: AssignWorkerGroupFlowsRequest) {
+ return api.post<WorkerGroupMoveResult>(
+ '/v1/worker-groups/assignments/flows',
+ request,
+ );
+ },
+ moveAll(request: MoveAllWorkerGroupRequest) {
+ return api.post<WorkerGroupMoveResult>(
+ '/v1/worker-groups/assignments/move-all',
+ request,
+ );
+ },
+ setRunLimit({
+ projectId,
+ maxConcurrentJobs,
+ }: {
+ projectId: string;
+ maxConcurrentJobs: number | null;
+ }) {
+ return api.post<ProjectWithLimits>(`/v1/projects/${projectId}`, {
+ maxConcurrentJobs,
+ });
+ },
+};
+
+type ListParams<T> = Omit<T, 'limit' | 'cursor' | 'exclude'> & {
+ exclude?: string;
+ limit?: number;
+ cursor?: string;
+};
diff --git a/packages/web/src/app/routes/platform/infra/workers/worker-groups/group-cards.tsx b/packages/web/src/app/routes/platform/infra/workers/worker-groups/group-cards.tsx
new file mode 100644
index 00000000000..bd812f99c92
--- /dev/null
+++ b/packages/web/src/app/routes/platform/infra/workers/worker-groups/group-cards.tsx
@@ -0,0 +1,438 @@
+import { WorkerGroupSummary, WorkerGroupsOverview } from '@activepieces/shared';
+import { t } from 'i18next';
+import { ChevronRight, Layers, LucideIcon, Workflow } from 'lucide-react';
+import React, { useLayoutEffect, useRef, useState } from 'react';
+
+import { StatusDot, adminSurface } from '@/app/components/admin';
+import { TextWithTooltip } from '@/components/custom/text-with-tooltip';
+import { Button } from '@/components/ui/button';
+import { Skeleton } from '@/components/ui/skeleton';
+import { AdminControl, adminControl } from '@/lib/admin-control';
+import { cn } from '@/lib/utils';
+
+import { groupUtils } from './hooks';
+
+export function GroupCards({
+ overview,
+ onOpen,
+ onAdd,
+}: {
+ overview: WorkerGroupsOverview | undefined;
+ onOpen: (key: string) => void;
+ onAdd: (group: WorkerGroupSummary) => void;
+}) {
+ if (!overview) {
+ return (
+ <GroupSection kind="project">
+ {[0, 1, 2].map((i) => (
+ <Skeleton key={i} className="h-50.5 rounded-xl" />
+ ))}
+ </GroupSection>
+ );
+ }
+ const groups = [...overview.groups].sort((a, b) =>
+ a.label.localeCompare(b.label),
+ );
+ const flowGroups = groups.filter((g) => g.scope === 'flow');
+ const projectGroups = groups.filter((g) => g.scope !== 'flow');
+ const card = (group: WorkerGroupSummary) => (
+ <GroupCard
+ key={`${group.scope}:${group.label}`}
+ group={group}
+ onOpen={() =>
+ onOpen(groupUtils.urlKey({ label: group.label, scope: group.scope }))
+ }
+ onAdd={() => onAdd(group)}
+ />
+ );
+ return (
+ <div className="flex flex-col gap-8">
+ <GroupSection kind="project">
+ <SharedCard
+ overview={overview}
+ onOpen={() =>
+ onOpen(groupUtils.urlKey({ label: null, scope: 'project' }))
+ }
+ />
+ {projectGroups.map(card)}
+ </GroupSection>
+ {flowGroups.length > 0 && (
+ <GroupSection kind="flow">{flowGroups.map(card)}</GroupSection>
+ )}
+ </div>
+ );
+}
+
+function GroupSection({
+ kind,
+ children,
+}: {
+ kind: 'project' | 'flow';
+ children: React.ReactNode;
+}) {
+ return (
+ <section className="flex flex-col gap-3">
+ <div className="flex flex-col gap-0.5">
+ <h2 className="text-base font-semibold text-gray-12">
+ {kind === 'flow' ? t('Flow groups') : t('Project groups')}
+ </h2>
+ <p className="text-sm text-gray-11">
+ {kind === 'flow'
+ ? t(
+ 'Only the flows picked here run on these servers. Their projects stay where they are.',
+ )
+ : t(
+ 'Each project here runs with all its flows, unless a flow has its own group.',
+ )}
+ </p>
+ </div>
+ <div className={GRID}>{children}</div>
+ </section>
+ );
+}
+
+function GroupCard({
+ group,
+ onOpen,
+ onAdd,
+}: {
+ group: WorkerGroupSummary;
+ onOpen: () => void;
+ onAdd: () => void;
+}) {
+ const forFlows = group.scope === 'flow';
+ const count = forFlows ? group.flowCount : group.projectCount;
+ return (
+ <CardFrame
+ onOpen={onOpen}
+ label={groupUtils.name(group.label)}
+ footer={
+ <CardFooter aside={<OpenHint />}>
+ <span onClick={(e) => e.stopPropagation()}>
+ <Button
+ {...adminControl(AdminControl.WORKERS_ASSIGN_OPEN)}
+ size="sm"
+ variant="outline"
+ onClick={onAdd}
+ >
+ {forFlows ? t('Add flows') : t('Add projects')}
+ </Button>
+ </span>
+ </CardFooter>
+ }
+ >
+ <CardHeader name={groupUtils.name(group.label)} />
+ <CardStatus
+ online={group.online}
+ slots={group.slots}
+ waiting={group.waiting}
+ inUse={groupUtils.inUse(group)}
+ />
+ <RunsHere
+ icon={forFlows ? Workflow : Layers}
+ names={group.sample}
+ label={
+ forFlows
+ ? t('{count, plural, =1 {1 flow} other {{countText} flows}}', {
+ count,
+ countText: groupUtils.compact(count),
+ })
+ : t(
+ '{count, plural, =1 {1 project} other {{countText} projects}}',
+ { count, countText: groupUtils.compact(count) },
+ )
+ }
+ total={count}
+ empty={count === 0}
+ />
+ </CardFrame>
+ );
+}
+
+function SharedCard({
+ overview,
+ onOpen,
+}: {
+ overview: WorkerGroupsOverview;
+ onOpen: () => void;
+}) {
+ const shared = overview.defaultGroup;
+ return (
+ <CardFrame
+ onOpen={onOpen}
+ label={groupUtils.name(null)}
+ footer={
+ <CardFooter>
+ <Button
+ size="sm"
+ variant="outline"
+ onClick={(e) => {
+ e.stopPropagation();
+ onOpen();
+ }}
+ >
+ {t('View projects')}
+ </Button>
+ </CardFooter>
+ }
+ >
+ <CardHeader name={groupUtils.name(null)} />
+ <CardStatus
+ online={shared.online}
+ slots={shared.slots}
+ waiting={0}
+ inUse
+ />
+ <RunsHere
+ icon={Layers}
+ names={shared.sample}
+ label={t(
+ '{count, plural, =1 {1 project} other {{countText} projects}}',
+ {
+ count: shared.projectCount,
+ countText: groupUtils.compact(shared.projectCount),
+ },
+ )}
+ note={t('not in a group')}
+ total={shared.projectCount}
+ empty={shared.projectCount === 0}
+ />
+ </CardFrame>
+ );
+}
+
+function CardHeader({ name }: { name: string }) {
+ return (
+ <div className="flex h-7 items-center">
+ <TextWithTooltip tooltipMessage={name}>
+ <span className="text-base font-semibold text-gray-12">{name}</span>
+ </TextWithTooltip>
+ </div>
+ );
+}
+
+function CardStatus({
+ online,
+ slots,
+ waiting,
+ inUse,
+}: {
+ online: number;
+ slots: number;
+ waiting: number;
+ inUse: boolean;
+}) {
+ const down = online === 0 && inUse;
+ const waitingText =
+ waiting > 0
+ ? t('{count, plural, =1 {1 run waiting} other {# runs waiting}}', {
+ count: waiting,
+ })
+ : null;
+ const headline =
+ online > 0
+ ? t('{count, plural, =1 {1 worker online} other {# workers online}}', {
+ count: online,
+ })
+ : down
+ ? t('No workers online')
+ : t('Not in use');
+ const detail =
+ online > 0
+ ? waitingText ??
+ t('Concurrency {count, number}', {
+ count: slots,
+ })
+ : down
+ ? waitingText ?? t('No runs waiting')
+ : t('No workers use this name');
+ return (
+ <p className="flex min-w-0 items-center gap-2 text-sm">
+ <span className={ROW_GLYPH}>
+ <StatusDot
+ tone={down ? 'danger' : online > 0 ? 'success' : 'neutral'}
+ />
+ </span>
+ <span
+ className={cn(
+ 'shrink-0 font-medium',
+ down ? 'text-danger-11' : 'text-gray-12',
+ )}
+ >
+ {headline}
+ </span>
+ <span
+ className={cn(
+ 'min-w-0 truncate',
+ down && waiting > 0 ? 'text-danger-11' : 'text-gray-11',
+ )}
+ >
+ {detail}
+ </span>
+ </p>
+ );
+}
+
+function RunsHere({
+ icon: Icon,
+ names,
+ label,
+ note,
+ total,
+ empty,
+}: {
+ icon: LucideIcon;
+ names: string[];
+ label: string;
+ note?: string;
+ total: number;
+ empty: boolean;
+}) {
+ const glyph = (
+ <span className={cn(ROW_GLYPH, 'text-gray-10')}>
+ <Icon className="size-4" />
+ </span>
+ );
+ if (empty) {
+ return (
+ <p className={cn(RUNS_ROW, 'text-gray-11')}>
+ {glyph}
+ {t('Nothing yet')}
+ </p>
+ );
+ }
+ return (
+ <p className={RUNS_ROW}>
+ {glyph}
+ <span className="shrink-0 font-medium text-gray-12">{label}</span>
+ {note ? (
+ <span className="min-w-0 truncate text-gray-11">{note}</span>
+ ) : (
+ <WholeNames names={names} total={total} />
+ )}
+ </p>
+ );
+}
+
+function WholeNames({ names, total }: { names: string[]; total: number }) {
+ const ref = useRef<HTMLSpanElement>(null);
+ const [shown, setShown] = useState(names.length);
+ useLayoutEffect(() => {
+ const el = ref.current;
+ if (!el) return;
+ const fit = () => setShown(fitNames({ el, names, total }));
+ fit();
+ let active = true;
+ document.fonts.ready.then(() => active && fit()).catch(() => undefined);
+ const observer = new ResizeObserver(fit);
+ observer.observe(el);
+ return () => {
+ active = false;
+ observer.disconnect();
+ };
+ }, [names, total]);
+ const visible = names.slice(0, shown);
+ const more = total - visible.length;
+ if (visible.length === 0)
+ return <span ref={ref} className="min-w-0 flex-1" />;
+ return (
+ <span
+ ref={ref}
+ className="flex min-w-0 flex-1 gap-1 overflow-hidden whitespace-nowrap text-gray-11"
+ >
+ <span className="truncate">{visible.join(', ')}</span>
+ {more > 0 && <span className="shrink-0">{moreText(more)}</span>}
+ </span>
+ );
+}
+
+function fitNames({
+ el,
+ names,
+ total,
+}: {
+ el: HTMLElement;
+ names: string[];
+ total: number;
+}) {
+ const context = document.createElement('canvas').getContext('2d');
+ if (!context) return names.length;
+ const style = getComputedStyle(el);
+ context.font = `${style.fontStyle} ${style.fontWeight} ${style.fontSize} ${style.fontFamily}`;
+ for (let count = names.length; count > 0; count--) {
+ const more = total - count;
+ const extra =
+ more > 0 ? context.measureText(moreText(more)).width + NAMES_GAP_PX : 0;
+ if (
+ context.measureText(names.slice(0, count).join(', ')).width + extra <=
+ el.clientWidth
+ )
+ return count;
+ }
+ return 0;
+}
+
+function moreText(count: number) {
+ return t('+{count, number} more', { count });
+}
+
+function CardFooter({
+ children,
+ aside,
+}: {
+ children: React.ReactNode;
+ aside?: React.ReactNode;
+}) {
+ return (
+ <div className="mt-auto flex h-14 items-center justify-between gap-3 border-t px-5">
+ {children}
+ {aside}
+ </div>
+ );
+}
+
+function OpenHint() {
+ return (
+ <span className="flex shrink-0 items-center gap-0.5 text-sm text-gray-11 group-hover/card:text-gray-12">
+ {t('Open')}
+ <ChevronRight className="size-4" />
+ </span>
+ );
+}
+
+function CardFrame({
+ onOpen,
+ label,
+ footer,
+ children,
+}: {
+ onOpen: () => void;
+ label: string;
+ footer: React.ReactNode;
+ children: React.ReactNode;
+}) {
+ return (
+ <div
+ role="link"
+ tabIndex={0}
+ aria-label={t('Open {group}', { group: label })}
+ onClick={onOpen}
+ onKeyDown={(e) => {
+ if (e.key === 'Enter' && e.target === e.currentTarget) onOpen();
+ }}
+ className={cn(
+ adminSurface.card,
+ 'group/card flex min-w-0 cursor-pointer flex-col gap-4 overflow-hidden pt-5 outline-none transition-[border-color,box-shadow] hover:border-gray-8 hover:shadow-sm focus-visible:border-gray-8 focus-visible:ring-[3px] focus-visible:ring-gray-8/50',
+ )}
+ >
+ <div className="flex min-w-0 flex-col gap-4 px-5">{children}</div>
+ {footer}
+ </div>
+ );
+}
+
+const GRID =
+ 'grid grid-cols-[repeat(auto-fill,minmax(min(100%,max(21rem,calc((100%_-_2rem)/3))),1fr))] gap-4';
+const NAMES_GAP_PX = 4;
+const RUNS_ROW = 'flex h-7 min-w-0 items-center gap-2 text-sm';
+const ROW_GLYPH = 'flex w-4 shrink-0 justify-center';
diff --git a/packages/web/src/app/routes/platform/infra/workers/worker-groups/group-page.tsx b/packages/web/src/app/routes/platform/infra/workers/worker-groups/group-page.tsx
new file mode 100644
index 00000000000..5c9a0464729
--- /dev/null
+++ b/packages/web/src/app/routes/platform/infra/workers/worker-groups/group-page.tsx
@@ -0,0 +1,265 @@
+import {
+ WorkerGroupProjectAssignment,
+ WorkerGroupsOverview,
+} from '@activepieces/shared';
+import { t } from 'i18next';
+import { ArrowLeft } from 'lucide-react';
+import React, { useState } from 'react';
+
+import { StatusDot, adminSurface } from '@/app/components/admin';
+import { Button } from '@/components/ui/button';
+import { AdminControl, adminControl } from '@/lib/admin-control';
+import { cn } from '@/lib/utils';
+
+import { AddItemsDialog } from './add-items-dialog';
+import { groupUtils } from './hooks';
+import { MoveAllDialog } from './move-all-dialog';
+import { FlowsTable, ProjectsTable } from './tables';
+
+export function GroupPage({
+ overview,
+ groupKey,
+ search,
+ onSearchChange,
+ cursor,
+ onCursorChange,
+ onBack,
+ onOpenFlows,
+ showRunLimit,
+}: {
+ overview: WorkerGroupsOverview;
+ groupKey: string;
+ search: string;
+ onSearchChange: (value: string) => void;
+ cursor: string | undefined;
+ onCursorChange: (cursor: string | undefined) => void;
+ onBack: () => void;
+ onOpenFlows: (project: WorkerGroupProjectAssignment) => void;
+ showRunLimit: boolean;
+}) {
+ const { label, scope } = groupUtils.fromKey(groupKey);
+ const group = groupUtils.find({ overview, label, scope });
+ const isShared = label === null;
+ const [adding, setAdding] = useState(false);
+ const [movingAll, setMovingAll] = useState(false);
+
+ const back = (
+ <button
+ type="button"
+ onClick={onBack}
+ className="inline-flex w-fit items-center gap-1 text-sm font-medium text-gray-11 hover:text-gray-12"
+ >
+ <ArrowLeft className="size-4" />
+ {t('All groups')}
+ </button>
+ );
+
+ if (!isShared && !group) {
+ return (
+ <div className="flex flex-col gap-5">
+ <div
+ className={cn(
+ adminSurface.card,
+ 'flex flex-col items-start gap-3 p-5',
+ )}
+ >
+ <h2 className="text-lg font-semibold text-gray-12">
+ {t('Group not found')}
+ </h2>
+ <p className="text-sm text-gray-11">
+ {t(
+ 'No worker group called {name} exists on this platform. It may have been renamed, or its workers stopped.',
+ {
+ name: groupUtils.name(label),
+ },
+ )}
+ </p>
+ <Button variant="outline" size="sm" onClick={onBack}>
+ {t('Back to all groups')}
+ </Button>
+ </div>
+ </div>
+ );
+ }
+
+ const forFlows = scope === 'flow';
+ const inUse = group ? groupUtils.inUse(group) : true;
+ const online = group ? group.online : overview.defaultGroup.online;
+ const slots = group ? group.slots : overview.defaultGroup.slots;
+
+ return (
+ <div className="flex flex-col gap-5">
+ {back}
+ <div className="flex flex-wrap items-start justify-between gap-3">
+ <div className="flex min-w-0 flex-col gap-1">
+ <h2 className="truncate text-xl font-semibold text-gray-12">
+ {groupUtils.name(label)}
+ </h2>
+ <p className="text-sm text-gray-11">
+ {isShared
+ ? t(
+ 'Projects that are not in a group run here, with their flows.',
+ )
+ : forFlows
+ ? t(
+ 'Only the flows listed here run on this group. Their projects stay where they are.',
+ )
+ : t(
+ 'The projects listed here run on this group, with all their flows, unless a flow has its own group.',
+ )}
+ </p>
+ {label && (
+ <p className="text-xs text-gray-10">
+ {t('Workers join this group with')}{' '}
+ <code className="rounded bg-gray-3 px-1 py-0.5 font-mono text-gray-12">
+ AP_WORKER_GROUP_ID={label}
+ </code>
+ </p>
+ )}
+ </div>
+ {group && (
+ <div className="flex items-center gap-2">
+ {inUse && (
+ <Button
+ variant="outline"
+ size="sm"
+ onClick={() => setMovingAll(true)}
+ >
+ {t('Move all to…')}
+ </Button>
+ )}
+ <Button
+ {...adminControl(AdminControl.WORKERS_ASSIGN_OPEN)}
+ size="sm"
+ onClick={() => setAdding(true)}
+ >
+ {forFlows ? t('Add flows') : t('Add projects')}
+ </Button>
+ </div>
+ )}
+ </div>
+ <div className="flex flex-col gap-2 text-sm">
+ <GroupStatus
+ online={online}
+ slots={slots}
+ waiting={group?.waiting ?? 0}
+ inUse={inUse}
+ />
+ {group && group.online === 0 && inUse && (
+ <span className="text-gray-11">
+ {forFlows
+ ? t(
+ 'Runs sent here wait until a worker is back. Move its flows to another group to keep them running.',
+ )
+ : t(
+ 'Runs sent here wait until a worker is back. Move its projects to another group to keep them running.',
+ )}
+ </span>
+ )}
+ </div>
+ {forFlows && label ? (
+ <FlowsTable
+ overview={overview}
+ group={label}
+ showRemove
+ emptyText={t(
+ 'No flows run on this group yet. Use Add flows to pick some.',
+ )}
+ />
+ ) : (
+ <ProjectsTable
+ overview={overview}
+ label={label}
+ search={search}
+ onSearchChange={onSearchChange}
+ cursor={cursor}
+ onCursorChange={onCursorChange}
+ onOpenFlows={onOpenFlows}
+ showRunLimit={showRunLimit}
+ showRemove={!isShared}
+ emptyText={
+ isShared
+ ? t('Every project is in a group.')
+ : t(
+ 'No projects run on this group yet. Use Add projects to pick some.',
+ )
+ }
+ />
+ )}
+ {group && label && (
+ <>
+ <AddItemsDialog
+ open={adding}
+ onOpenChange={setAdding}
+ overview={overview}
+ label={label}
+ kind={forFlows ? 'flow' : 'project'}
+ />
+ <MoveAllDialog
+ group={group}
+ overview={overview}
+ open={movingAll}
+ onOpenChange={setMovingAll}
+ />
+ </>
+ )}
+ </div>
+ );
+}
+
+function GroupStatus({
+ online,
+ slots,
+ waiting,
+ inUse,
+}: {
+ online: number;
+ slots: number;
+ waiting: number;
+ inUse: boolean;
+}) {
+ const down = online === 0 && inUse;
+ const parts =
+ online > 0
+ ? [
+ t('{count, plural, =1 {1 worker online} other {# workers online}}', {
+ count: online,
+ }),
+ t('Concurrency {count, number}', {
+ count: slots,
+ }),
+ ]
+ : [
+ down ? t('No workers online') : t('Not in use'),
+ waiting > 0
+ ? t('{count, plural, =1 {1 run waiting} other {# runs waiting}}', {
+ count: waiting,
+ })
+ : null,
+ ];
+ const items = parts
+ .filter((part): part is string => part !== null)
+ .map((part, i) => (
+ <span key={i} className={down ? 'text-danger-11' : 'text-gray-12'}>
+ {part}
+ </span>
+ ));
+ return (
+ <p className="flex flex-wrap items-center gap-x-1.5 gap-y-1 text-sm max-sm:gap-x-3">
+ <StatusDot
+ tone={down ? 'danger' : online > 0 ? 'success' : 'neutral'}
+ className="mr-0.5 shrink-0"
+ />
+ {items.map((item, i) => (
+ <span key={i} className="inline-flex items-center gap-1.5">
+ {i > 0 && (
+ <span aria-hidden className="text-gray-10 max-sm:hidden">
+ ·
+ </span>
+ )}
+ {item}
+ </span>
+ ))}
+ </p>
+ );
+}
diff --git a/packages/web/src/app/routes/platform/infra/workers/worker-groups/hooks.ts b/packages/web/src/app/routes/platform/infra/workers/worker-groups/hooks.ts
new file mode 100644
index 00000000000..67654157ac0
--- /dev/null
+++ b/packages/web/src/app/routes/platform/infra/workers/worker-groups/hooks.ts
@@ -0,0 +1,494 @@
+import {
+ WORKER_GROUP_BULK_ASSIGN_MAX_ITEMS,
+ WorkerGroupFlowAssignmentPage,
+ WorkerGroupMoveResult,
+ WorkerGroupProjectAssignmentPage,
+ WorkerGroupScope,
+ WorkerGroupSummary,
+ WorkerGroupsOverview,
+ chunk,
+ tryCatch,
+} from '@activepieces/shared';
+import {
+ keepPreviousData,
+ useMutation,
+ useQuery,
+ useQueryClient,
+} from '@tanstack/react-query';
+import { t } from 'i18next';
+import { useEffect, useState } from 'react';
+import { toast } from 'sonner';
+
+import { projectCollectionUtils } from '@/features/projects';
+import { platformHooks } from '@/hooks/platform-hooks';
+
+import { workerGroupsApi } from './api';
+
+export const workerGroupsQueries = {
+ useOverview() {
+ const { platform } = platformHooks.useCurrentPlatform();
+ return useQuery({
+ queryKey: [...KEYS.root, 'overview'],
+ queryFn: () => workerGroupsApi.overview(),
+ refetchInterval: 15000,
+ enabled: platform.plan.workerGroupsEnabled,
+ });
+ },
+ useProjects({
+ params,
+ enabled = true,
+ }: {
+ params: ProjectListParams;
+ enabled?: boolean;
+ }) {
+ return useQuery({
+ queryKey: [...KEYS.lists, 'projects', params],
+ queryFn: () => workerGroupsApi.projects({ limit: PAGE_SIZE, ...params }),
+ placeholderData: keepPreviousData,
+ enabled,
+ });
+ },
+ useFlows({
+ params,
+ enabled = true,
+ }: {
+ params: FlowListParams;
+ enabled?: boolean;
+ }) {
+ return useQuery({
+ queryKey: [...KEYS.lists, 'flows', params],
+ queryFn: () =>
+ workerGroupsApi.flows({
+ limit: params.projectId ? PROJECT_FLOWS_PAGE_SIZE : PAGE_SIZE,
+ ...params,
+ }),
+ placeholderData: keepPreviousData,
+ enabled,
+ });
+ },
+ useSearch({
+ kind,
+ query,
+ cursor,
+ }: {
+ kind: 'project' | 'flow';
+ query: string;
+ cursor: string | undefined;
+ }) {
+ const debounced = useDebounced({ value: query.trim(), ms: 200 });
+ return useQuery({
+ queryKey: [...KEYS.lists, 'search', kind, debounced, cursor],
+ queryFn: (): Promise<SearchPage> => {
+ const params = {
+ filter: 'all' as const,
+ search: debounced,
+ limit: SEARCH_PAGE_SIZE,
+ cursor,
+ };
+ return kind === 'project'
+ ? workerGroupsApi.projects(params)
+ : workerGroupsApi.flows(params);
+ },
+ enabled: debounced.length > 0,
+ placeholderData: keepPreviousData,
+ });
+ },
+};
+
+export function useMover() {
+ const queryClient = useQueryClient();
+
+ const move = async ({
+ items,
+ to,
+ }: {
+ items: MoveItem[];
+ to: string | null;
+ }) => {
+ const changed = items.filter((item) => item.from !== to);
+ if (changed.length === 0) return false;
+ const { done, waiting, failed } = await sendMovesInParts({
+ items: changed,
+ to,
+ });
+ if (done.length === 0) {
+ toast.error(t('Could not move. Nothing was changed.'));
+ return false;
+ }
+ await queryClient.invalidateQueries({ queryKey: KEYS.root });
+ const notify = failed ? toast.error : toast.success;
+ notify(
+ failed
+ ? t(
+ 'Moved {done, number} of {total, number}. The rest could not be moved.',
+ { done: done.length, total: changed.length },
+ )
+ : movedMessage({
+ to,
+ waiting,
+ projects: done.filter((i) => i.kind === 'project').length,
+ flows: done.filter((i) => i.kind === 'flow').length,
+ }),
+ {
+ id: MOVE_TOAST_ID,
+ style: TOAST_STYLE,
+ action: {
+ label: t('Undo'),
+ onClick: () => {
+ undoMoves({ items: done })
+ .then(() => toast.success(t('Move undone.')))
+ .catch(() => toast.error(t('Could not undo the move.')))
+ .finally(() =>
+ queryClient.invalidateQueries({ queryKey: KEYS.root }),
+ );
+ },
+ },
+ },
+ );
+ return true;
+ };
+
+ const moveAll = async ({
+ from,
+ scope,
+ to,
+ }: {
+ from: string;
+ scope: GroupScope;
+ to: string | null;
+ }) => {
+ const { data: result, error } = await tryCatch(() =>
+ workerGroupsApi.moveAll({
+ from,
+ scope:
+ scope === 'flow' ? WorkerGroupScope.FLOW : WorkerGroupScope.PROJECT,
+ to,
+ }),
+ );
+ if (error) {
+ toast.error(t('Could not move. Nothing was changed.'));
+ return false;
+ }
+ projectCollectionUtils.setWorkerGroup({
+ projectIds: result.projects,
+ workerGroupId: to,
+ });
+ await queryClient.invalidateQueries({ queryKey: KEYS.root });
+ if (result.projects.length + result.flows.length === 0) {
+ toast.success(t('Nothing was left to move.'), { id: MOVE_TOAST_ID });
+ return true;
+ }
+ toast.success(
+ movedMessage({
+ to,
+ waiting: result.movedWaitingRuns,
+ projects: result.projects.length,
+ flows: result.flows.length,
+ }),
+ {
+ id: MOVE_TOAST_ID,
+ style: TOAST_STYLE,
+ action: {
+ label: t('Undo'),
+ onClick: () => {
+ sendMoves({
+ items: [
+ ...result.projects.map((id) => ({
+ kind: 'project' as const,
+ id,
+ from: to,
+ })),
+ ...result.flows.map((id) => ({
+ kind: 'flow' as const,
+ id,
+ from: to,
+ })),
+ ],
+ to: from,
+ })
+ .then(() => toast.success(t('Move undone.')))
+ .catch(() => toast.error(t('Could not undo the move.')))
+ .finally(() =>
+ queryClient.invalidateQueries({ queryKey: KEYS.root }),
+ );
+ },
+ },
+ },
+ );
+ return true;
+ };
+
+ return { move, moveAll };
+}
+
+export function useRunLimit() {
+ const queryClient = useQueryClient();
+ return useMutation({
+ mutationFn: workerGroupsApi.setRunLimit,
+ onSuccess: async (project, { maxConcurrentJobs }) => {
+ projectCollectionUtils.syncFromServer(project);
+ await queryClient.invalidateQueries({ queryKey: KEYS.lists });
+ toast.success(
+ maxConcurrentJobs === null
+ ? t('{project} now uses the default concurrency limit.', {
+ project: project.displayName,
+ })
+ : t('{project} now has a concurrency limit of {count, number}.', {
+ project: project.displayName,
+ count: maxConcurrentJobs,
+ }),
+ );
+ },
+ onError: () => {
+ toast.error(
+ t('Could not save the concurrency limit. Nothing was changed.'),
+ );
+ },
+ });
+}
+
+export const groupUtils = {
+ name(label: string | null) {
+ return label === null ? t('Shared workers') : label.replaceAll('_', ' ');
+ },
+ urlKey({ label, scope }: GroupRef) {
+ return label === null ? SHARED_KEY : `${scope}:${label}`;
+ },
+ fromKey(key: string): GroupRef {
+ if (key === SHARED_KEY) return { label: null, scope: 'project' };
+ if (key.startsWith(FLOW_KEY_PREFIX))
+ return { label: key.slice(FLOW_KEY_PREFIX.length), scope: 'flow' };
+ if (key.startsWith(PROJECT_KEY_PREFIX))
+ return { label: key.slice(PROJECT_KEY_PREFIX.length), scope: 'project' };
+ return { label: key, scope: 'project' };
+ },
+ projectListParams(
+ label: string | null,
+ ): Pick<ProjectListParams, 'group' | 'filter'> {
+ return label === null ? { filter: 'shared' } : { group: label };
+ },
+ quote(name: string) {
+ return `“${name}”`;
+ },
+ find({
+ overview,
+ label,
+ scope,
+ }: GroupRef & { overview: WorkerGroupsOverview | undefined }) {
+ if (label === null || !overview) return undefined;
+ return overview.groups.find((g) => g.label === label && g.scope === scope);
+ },
+ capacity({ online, slots }: { online: number; slots: number }) {
+ return t(
+ '{workers, plural, =1 {1 worker} other {# workers}} · concurrency {slots, number}',
+ { workers: online, slots },
+ );
+ },
+ usage({
+ projectCount,
+ flowCount,
+ }: {
+ projectCount: number;
+ flowCount: number;
+ }) {
+ return t(
+ '{projects, plural, =1 {1 project} other {{projectsText} projects}} · {flows, plural, =1 {1 flow} other {{flowsText} flows}}',
+ {
+ projects: projectCount,
+ flows: flowCount,
+ projectsText: compact(projectCount),
+ flowsText: compact(flowCount),
+ },
+ );
+ },
+ flowUsage(flowCount: number) {
+ return t('{flows, plural, =1 {1 flow} other {{flowsText} flows}}', {
+ flows: flowCount,
+ flowsText: compact(flowCount),
+ });
+ },
+ compact(value: number) {
+ return compact(value);
+ },
+ inUse(
+ group: Pick<WorkerGroupSummary, 'scope' | 'projectCount' | 'flowCount'>,
+ ) {
+ return group.scope === 'project'
+ ? group.projectCount > 0
+ : group.flowCount > 0;
+ },
+};
+
+function compact(value: number) {
+ return new Intl.NumberFormat(undefined, {
+ notation: value >= 1000 ? 'compact' : 'standard',
+ maximumFractionDigits: 1,
+ }).format(value);
+}
+
+export function useDebounced({ value, ms }: { value: string; ms: number }) {
+ const [current, setCurrent] = useState(value);
+ useEffect(() => {
+ const id = window.setTimeout(() => setCurrent(value), ms);
+ return () => window.clearTimeout(id);
+ }, [value, ms]);
+ return current;
+}
+
+async function sendMoves({
+ items,
+ to,
+}: {
+ items: MoveItem[];
+ to: string | null;
+}) {
+ const { waiting, failed } = await sendMovesInParts({ items, to });
+ if (failed) throw new Error('move failed');
+ return waiting;
+}
+
+async function sendMovesInParts({
+ items,
+ to,
+}: {
+ items: MoveItem[];
+ to: string | null;
+}) {
+ const done: MoveItem[] = [];
+ let waiting = 0;
+ const senders: MoveSender[] = [
+ {
+ kind: 'project',
+ send: (ids) =>
+ workerGroupsApi.assignProjects({ projects: ids, workerGroupId: to }),
+ },
+ {
+ kind: 'flow',
+ send: (ids) =>
+ workerGroupsApi.assignFlows({ flows: ids, workerGroupId: to }),
+ },
+ ];
+ for (const { kind, send } of senders) {
+ const kindItems = items.filter((item) => item.kind === kind);
+ for (const part of chunk(kindItems, WORKER_GROUP_BULK_ASSIGN_MAX_ITEMS)) {
+ const { data, error } = await tryCatch(() =>
+ send(part.map((item) => item.id)),
+ );
+ if (error) return { done, waiting, failed: true };
+ if (kind === 'project') {
+ projectCollectionUtils.setWorkerGroup({
+ projectIds: part.map((item) => item.id),
+ workerGroupId: to,
+ });
+ }
+ done.push(...part);
+ waiting += data.movedWaitingRuns;
+ }
+ }
+ return { done, waiting, failed: false };
+}
+
+async function undoMoves({ items }: { items: MoveItem[] }) {
+ const byTarget = new Map<string | null, MoveItem[]>();
+ items.forEach((item) => {
+ byTarget.set(item.from, [...(byTarget.get(item.from) ?? []), item]);
+ });
+ for (const [from, group] of byTarget) {
+ await sendMoves({ items: group, to: from });
+ }
+}
+
+function movedMessage({
+ to,
+ waiting,
+ projects,
+ flows,
+}: {
+ to: string | null;
+ waiting: number;
+ projects: number;
+ flows: number;
+}) {
+ const target = groupUtils.name(to);
+ const what =
+ projects > 0 && flows > 0
+ ? t(
+ 'Moved {projects, plural, =1 {1 project} other {# projects}} and {flows, plural, =1 {1 flow} other {# flows}} to {group}.',
+ { projects, flows, group: target },
+ )
+ : projects > 0
+ ? t(
+ 'Moved {count, plural, =1 {1 project} other {# projects}} to {group}.',
+ { count: projects, group: target },
+ )
+ : to === null
+ ? t(
+ 'Moved {count, plural, =1 {1 flow back to its project group.} other {# flows back to their project groups.}}',
+ { count: flows },
+ )
+ : t('Moved {count, plural, =1 {1 flow} other {# flows}} to {group}.', {
+ count: flows,
+ group: target,
+ });
+ if (waiting === 0) return what;
+ return `${what} ${t(
+ '{count, plural, =1 {1 waiting run went with them.} other {# waiting runs went with them.}}',
+ { count: waiting },
+ )}`;
+}
+
+const FLOW_KEY_PREFIX = 'flow:';
+const PROJECT_KEY_PREFIX = 'project:';
+const SHARED_KEY = 'shared:';
+const MOVE_TOAST_ID = 'worker-group-move';
+const TOAST_STYLE = {
+ width: 'max-content',
+ maxWidth: 'min(720px, calc(100vw - 32px))',
+};
+
+const KEYS = {
+ root: ['worker-groups-v2'],
+ lists: ['worker-groups-v2', 'lists'],
+};
+
+export const PAGE_SIZE = 50;
+const SEARCH_PAGE_SIZE = 10;
+export const PROJECT_FLOWS_PAGE_SIZE = 20;
+
+type ProjectListParams = {
+ group?: string;
+ filter?: 'all' | 'shared';
+ exclude?: string;
+ search?: string;
+ cursor?: string;
+};
+
+type FlowListParams = {
+ limit?: number;
+ group?: string;
+ filter?: 'all' | 'pinned';
+ exclude?: string;
+ projectId?: string;
+ search?: string;
+ cursor?: string;
+};
+
+export type MoveItem = {
+ kind: 'project' | 'flow';
+ id: string;
+ from: string | null;
+ flows?: number;
+};
+
+type MoveSender = {
+ kind: MoveItem['kind'];
+ send: (ids: string[]) => Promise<WorkerGroupMoveResult>;
+};
+
+type SearchPage =
+ | WorkerGroupProjectAssignmentPage
+ | WorkerGroupFlowAssignmentPage;
+
+type GroupScope = 'project' | 'flow';
+
+type GroupRef = { label: string | null; scope: GroupScope };
diff --git a/packages/web/src/app/routes/platform/infra/workers/worker-groups/move-all-dialog.tsx b/packages/web/src/app/routes/platform/infra/workers/worker-groups/move-all-dialog.tsx
new file mode 100644
index 00000000000..27172af9128
--- /dev/null
+++ b/packages/web/src/app/routes/platform/infra/workers/worker-groups/move-all-dialog.tsx
@@ -0,0 +1,215 @@
+import { WorkerGroupSummary, WorkerGroupsOverview } from '@activepieces/shared';
+import { t } from 'i18next';
+import React, { useState } from 'react';
+
+import { StatusDot, adminLayout, adminSurface } from '@/app/components/admin';
+import { Button } from '@/components/ui/button';
+import {
+ Dialog,
+ DialogContent,
+ DialogDescription,
+ DialogFooter,
+ DialogHeader,
+ DialogTitle,
+} from '@/components/ui/dialog';
+import { RadioGroup, RadioGroupItem } from '@/components/ui/radio-group';
+import { cn } from '@/lib/utils';
+
+import { groupUtils, useMover } from './hooks';
+import { SearchBox } from './parts';
+
+export function MoveAllDialog({
+ group,
+ overview,
+ open,
+ onOpenChange,
+ selected,
+}: {
+ group: WorkerGroupSummary;
+ overview: WorkerGroupsOverview | undefined;
+ open: boolean;
+ onOpenChange: (open: boolean) => void;
+ selected?: number;
+}) {
+ return (
+ <Dialog open={open} onOpenChange={onOpenChange}>
+ <DialogContent
+ className={adminLayout.dialog.md}
+ onOpenAutoFocus={(e) => e.preventDefault()}
+ >
+ {open && (
+ <MoveAllForm
+ group={group}
+ overview={overview}
+ selected={selected}
+ onDone={() => onOpenChange(false)}
+ />
+ )}
+ </DialogContent>
+ </Dialog>
+ );
+}
+
+function MoveAllForm({
+ group,
+ overview,
+ selected,
+ onDone,
+}: {
+ group: WorkerGroupSummary;
+ overview: WorkerGroupsOverview | undefined;
+ selected: number | undefined;
+ onDone: () => void;
+}) {
+ const [target, setTarget] = useState<string | null>(null);
+ const [filter, setFilter] = useState('');
+ const [saving, setSaving] = useState(false);
+ const { moveAll } = useMover();
+ const forFlows = group.scope === 'flow';
+ const targets = (overview?.groups ?? []).filter(
+ (g) => g.scope === group.scope && g.label !== group.label,
+ );
+ const options = [
+ {
+ key: BACK_KEY,
+ name: forFlows
+ ? t('Back to each flow’s project group')
+ : groupUtils.name(null),
+ health: forFlows ? null : overview?.defaultGroup ?? null,
+ },
+ ...targets.map((g) => ({
+ key: g.label,
+ name: groupUtils.name(g.label),
+ health: g,
+ })),
+ ].filter((option) =>
+ option.name.toLowerCase().includes(filter.trim().toLowerCase()),
+ );
+ const to = target === BACK_KEY ? null : target;
+ const picked =
+ target === null
+ ? undefined
+ : groupUtils.find({ overview, label: to, scope: group.scope });
+ const what = forFlows
+ ? t('{count, plural, =1 {1 flow} other {# flows}}', {
+ count: group.flowCount,
+ })
+ : t(
+ '{projects, plural, =1 {1 project} other {# projects}} ({flows, plural, =1 {1 flow} other {# flows}})',
+ {
+ projects: group.projectCount,
+ flows: group.flowCount,
+ },
+ );
+
+ return (
+ <>
+ <DialogHeader className="mb-0">
+ <DialogTitle>
+ {selected !== undefined
+ ? forFlows
+ ? t(
+ 'Move {count, plural, =1 {1 selected flow} other {# selected flows}}',
+ { count: selected },
+ )
+ : t(
+ 'Move {count, plural, =1 {1 selected project} other {# selected projects}}',
+ { count: selected },
+ )
+ : t('Move all from {group}', {
+ group: groupUtils.name(group.label),
+ })}
+ </DialogTitle>
+ <DialogDescription>
+ {[
+ t('{what} will move to the group you pick.', { what }),
+ group.waiting > 0
+ ? t(
+ '{count, plural, =1 {1 waiting run goes with them.} other {# waiting runs go with them.}}',
+ {
+ count: group.waiting,
+ },
+ )
+ : null,
+ ]
+ .filter(Boolean)
+ .join(' ')}
+ </DialogDescription>
+ </DialogHeader>
+ {targets.length > SEARCH_AFTER && (
+ <SearchBox
+ value={filter}
+ onChange={setFilter}
+ placeholder={t('Find a group')}
+ />
+ )}
+ <RadioGroup
+ value={target ?? ''}
+ onValueChange={setTarget}
+ className={cn(
+ adminSurface.listFrame,
+ adminSurface.divider,
+ 'max-h-72 gap-0 divide-y overflow-y-auto',
+ )}
+ >
+ {options.map((option) => (
+ <label
+ key={option.key}
+ className="flex h-11 cursor-pointer items-center gap-3 px-3 hover:bg-gray-2"
+ >
+ <RadioGroupItem value={option.key} />
+ <span className="flex-1 truncate text-sm text-gray-12">
+ {option.name}
+ </span>
+ {option.health && (
+ <StatusDot
+ tone={option.health.online > 0 ? 'success' : 'danger'}
+ className={cn(
+ 'w-36 shrink-0 text-xs',
+ option.health.online > 0 ? 'text-gray-10' : 'text-danger-11',
+ )}
+ >
+ {option.health.online > 0
+ ? t('Concurrency {count, number}', {
+ count: option.health.slots,
+ })
+ : t('No workers online')}
+ </StatusDot>
+ )}
+ </label>
+ ))}
+ </RadioGroup>
+ {picked && picked.online === 0 && (
+ <p className="text-sm text-danger-11">
+ {t(
+ 'The group {group} has no workers online. Runs will wait there until a worker is back.',
+ {
+ group: groupUtils.name(picked.label),
+ },
+ )}
+ </p>
+ )}
+ <DialogFooter className="mt-0">
+ <Button variant="outline" onClick={onDone}>
+ {t('Cancel')}
+ </Button>
+ <Button
+ disabled={target === null}
+ loading={saving}
+ onClick={() => {
+ setSaving(true);
+ moveAll({ from: group.label, scope: group.scope, to })
+ .then((moved) => moved && onDone())
+ .catch(() => undefined)
+ .finally(() => setSaving(false));
+ }}
+ >
+ {t('Move')}
+ </Button>
+ </DialogFooter>
+ </>
+ );
+}
+
+const BACK_KEY = 'back:';
+const SEARCH_AFTER = 7;
diff --git a/packages/web/src/app/routes/platform/infra/workers/worker-groups/parts.tsx b/packages/web/src/app/routes/platform/infra/workers/worker-groups/parts.tsx
new file mode 100644
index 00000000000..0ec49382eb8
--- /dev/null
+++ b/packages/web/src/app/routes/platform/infra/workers/worker-groups/parts.tsx
@@ -0,0 +1,708 @@
+import {
+ ColorName,
+ PROJECT_COLOR_PALETTE,
+ WorkerGroupSummary,
+ WorkerGroupsOverview,
+} from '@activepieces/shared';
+import { t } from 'i18next';
+import {
+ Check,
+ ChevronDown,
+ ChevronLeft,
+ ChevronRight,
+ Search,
+ TriangleAlert,
+ Workflow,
+ X,
+} from 'lucide-react';
+import React, { useState } from 'react';
+
+import { StatusDot, adminLayout } from '@/app/components/admin';
+import { Button } from '@/components/ui/button';
+import {
+ Command,
+ CommandGroup,
+ CommandInput,
+ CommandItem,
+ CommandList,
+} from '@/components/ui/command';
+import {
+ Dialog,
+ DialogContent,
+ DialogDescription,
+ DialogFooter,
+ DialogHeader,
+ DialogTitle,
+} from '@/components/ui/dialog';
+import { Input } from '@/components/ui/input';
+import {
+ Popover,
+ PopoverContent,
+ PopoverTrigger,
+} from '@/components/ui/popover';
+import {
+ Tooltip,
+ TooltipContent,
+ TooltipTrigger,
+} from '@/components/ui/tooltip';
+import { AdminControl, adminControl } from '@/lib/admin-control';
+import { cn } from '@/lib/utils';
+
+import { MoveItem, groupUtils, useMover } from './hooks';
+import { MoveAllDialog } from './move-all-dialog';
+
+export function WorkerGroupSelect({
+ kind,
+ value,
+ inherited,
+ overview,
+ onChange,
+ subject,
+ detail,
+ confirmEvery,
+ trigger,
+ excludeLabel,
+ firstOption,
+ emptyHint,
+ align = 'start',
+ disabled = false,
+}: {
+ kind: 'project' | 'flow';
+ value: string | null | undefined;
+ inherited?: string | null;
+ overview: WorkerGroupsOverview | undefined;
+ onChange: (to: string | null) => void;
+ subject: string;
+ detail?: string;
+ confirmEvery?: (to: string | null) => { title: string; body: string };
+ trigger?: React.ReactNode;
+ excludeLabel?: string | null;
+ firstOption?: string;
+ emptyHint?: string;
+ align?: 'start' | 'end';
+ disabled?: boolean;
+}) {
+ const [open, setOpen] = useState(false);
+ const [active, setActive] = useState(NO_ACTIVE_OPTION);
+ const [confirming, setConfirming] = useState<{ to: string | null } | null>(
+ null,
+ );
+ const groups = (overview?.groups ?? []).filter(
+ (g) => g.scope === kind && g.label !== excludeLabel,
+ );
+ const first =
+ firstOption ??
+ (kind === 'flow'
+ ? t('Same as project ({group})', {
+ group: groupUtils.name(inherited ?? null),
+ })
+ : t('Shared workers'));
+
+ const pick = (to: string | null) => {
+ setOpen(false);
+ if (to === value) return;
+ const target = groupUtils.find({ overview, label: to, scope: kind });
+ if (confirmEvery || (target && target.online === 0)) {
+ setConfirming({ to });
+ return;
+ }
+ onChange(to);
+ };
+
+ const confirmText = confirming
+ ? confirmEvery
+ ? confirmEvery(confirming.to)
+ : {
+ title: t('Move {subject} to {group}?', {
+ subject,
+ group: groupUtils.name(confirming.to),
+ }),
+ body: detail ?? '',
+ }
+ : null;
+ const targetDown =
+ confirming !== null &&
+ groupUtils.find({ overview, label: confirming.to, scope: kind })?.online ===
+ 0;
+
+ return (
+ <>
+ <Popover
+ open={open}
+ onOpenChange={(next) => {
+ setOpen(next);
+ setActive(NO_ACTIVE_OPTION);
+ }}
+ >
+ <PopoverTrigger asChild>
+ {trigger ?? (
+ <Button
+ variant="outline"
+ size="sm"
+ disabled={disabled}
+ className="w-full justify-between gap-3 font-normal"
+ title={selectedText({ kind, value: value ?? null, inherited })}
+ >
+ <SelectedLabel
+ kind={kind}
+ value={value ?? null}
+ inherited={inherited}
+ overview={overview}
+ />
+ <ChevronDown className="size-4 shrink-0 text-gray-10" />
+ </Button>
+ )}
+ </PopoverTrigger>
+ <PopoverContent
+ className="w-auto min-w-[max(var(--radix-popover-trigger-width),18rem)] max-w-96 p-1"
+ align={align}
+ collisionPadding={16}
+ >
+ <Command value={active} onValueChange={setActive}>
+ {groups.length > PICKER_SEARCH_AFTER && (
+ <CommandInput placeholder={t('Find a group')} />
+ )}
+ <CommandList className="max-h-[19.5rem] overflow-y-auto">
+ <CommandGroup>
+ {excludeLabel !== null && (
+ <Option
+ title={first}
+ health={
+ kind === 'project' && !firstOption
+ ? overview?.defaultGroup ?? null
+ : null
+ }
+ checkable={value !== undefined}
+ selected={value === null}
+ onSelect={() => pick(null)}
+ />
+ )}
+ {groups.map((g) => (
+ <Option
+ key={g.label}
+ title={groupUtils.name(g.label)}
+ health={g}
+ checkable={value !== undefined}
+ selected={value === g.label}
+ onSelect={() => pick(g.label)}
+ />
+ ))}
+ </CommandGroup>
+ </CommandList>
+ </Command>
+ {groups.length === 0 && <NoGroupsHint kind={kind} text={emptyHint} />}
+ </PopoverContent>
+ </Popover>
+ <Dialog
+ open={confirming !== null}
+ onOpenChange={(o) => !o && setConfirming(null)}
+ >
+ <DialogContent className={adminLayout.dialog.sm}>
+ {confirmText && (
+ <>
+ <DialogHeader className="mb-0">
+ <DialogTitle className="pr-6">{confirmText.title}</DialogTitle>
+ {confirmText.body && (
+ <DialogDescription>{confirmText.body}</DialogDescription>
+ )}
+ </DialogHeader>
+ {targetDown && (
+ <p className="flex items-start gap-2 text-sm text-danger-11">
+ <TriangleAlert className="mt-0.5 size-4 shrink-0" />
+ {t(
+ 'The group {group} has no workers online. Runs will wait there until a worker is back.',
+ {
+ group: groupUtils.name(confirming?.to ?? null),
+ },
+ )}
+ </p>
+ )}
+ <DialogFooter className="mt-0">
+ <Button variant="outline" onClick={() => setConfirming(null)}>
+ {t('Cancel')}
+ </Button>
+ <Button
+ onClick={() => {
+ const to = confirming?.to ?? null;
+ setConfirming(null);
+ onChange(to);
+ }}
+ >
+ {targetDown ? t('Move anyway') : t('Move')}
+ </Button>
+ </DialogFooter>
+ </>
+ )}
+ </DialogContent>
+ </Dialog>
+ </>
+ );
+}
+
+export function SelectedLabel({
+ kind,
+ value,
+ inherited,
+ overview,
+}: {
+ kind: 'project' | 'flow';
+ value: string | null;
+ inherited?: string | null;
+ overview: WorkerGroupsOverview | undefined;
+}) {
+ const effective =
+ kind === 'flow' && value === null ? inherited ?? null : value;
+ const group = groupUtils.find({
+ overview,
+ label: effective,
+ scope: kind === 'flow' && value === null ? 'project' : kind,
+ });
+ const down = group !== undefined && group.online === 0;
+ return (
+ <span className="flex min-w-0 items-center gap-2">
+ {down && (
+ <>
+ <StatusDot tone="danger" />
+ <span className="sr-only">{t('No workers online')}</span>
+ </>
+ )}
+ <span className="truncate">
+ {selectedText({ kind, value, inherited })}
+ </span>
+ </span>
+ );
+}
+
+export function SearchBox({
+ value,
+ onChange,
+ placeholder,
+}: {
+ value: string;
+ onChange: (value: string) => void;
+ placeholder: string;
+}) {
+ return (
+ <div className="relative w-full max-w-sm">
+ <Search className="absolute left-3 top-1/2 size-4 -translate-y-1/2 text-gray-10" />
+ <Input
+ className="px-9"
+ aria-label={placeholder}
+ placeholder={placeholder}
+ value={value}
+ onChange={(e) => onChange(e.target.value)}
+ />
+ {value && (
+ <button
+ type="button"
+ aria-label={t('Clear search')}
+ onClick={() => onChange('')}
+ className="absolute right-2 top-1/2 flex size-6 -translate-y-1/2 items-center justify-center rounded-md text-gray-10 hover:bg-gray-3 hover:text-gray-12"
+ >
+ <X className="size-4" />
+ </button>
+ )}
+ </div>
+ );
+}
+
+export function Pager({
+ offset,
+ count,
+ total,
+ noun,
+ onPrevious,
+ onNext,
+}: {
+ offset: number;
+ count: number;
+ total: number;
+ noun?: string;
+ onPrevious?: () => void;
+ onNext?: () => void;
+}) {
+ const single = total <= count && offset === 0;
+ if (single && !noun) return null;
+ return (
+ <div className="flex h-8 items-center justify-end gap-2 text-sm text-gray-11">
+ <span className="tabular-nums">
+ {single
+ ? `${total.toLocaleString()} ${noun}`
+ : t('{from}–{to} of {total}', {
+ from: (offset + 1).toLocaleString(),
+ to: (offset + count).toLocaleString(),
+ total: total.toLocaleString(),
+ })}
+ </span>
+ {!single && (
+ <>
+ <Button
+ variant="ghost"
+ size="icon-sm"
+ disabled={!onPrevious}
+ onClick={onPrevious}
+ aria-label={t('Previous page')}
+ >
+ <ChevronLeft />
+ </Button>
+ <Button
+ variant="ghost"
+ size="icon-sm"
+ disabled={!onNext}
+ onClick={onNext}
+ aria-label={t('Next page')}
+ >
+ <ChevronRight />
+ </Button>
+ </>
+ )}
+ </div>
+ );
+}
+
+export function SelectionBar({
+ items,
+ kind,
+ overview,
+ onDone,
+ selectAll,
+ inline = false,
+}: {
+ items: MoveItem[];
+ kind: 'project' | 'flow';
+ overview: WorkerGroupsOverview | undefined;
+ onDone: () => void;
+ selectAll?: {
+ total: number;
+ group: WorkerGroupSummary;
+ active: boolean;
+ onToggle: () => void;
+ };
+ inline?: boolean;
+}) {
+ const { move } = useMover();
+ const [movingAll, setMovingAll] = useState(false);
+ if (items.length === 0) return null;
+ if (selectAll?.active) {
+ return (
+ <BarFrame inline={inline}>
+ <span className="text-sm text-gray-11">
+ {t('All {count, number} selected', { count: selectAll.total })}
+ </span>
+ <Button size="sm" onClick={() => setMovingAll(true)}>
+ {t('Move to…')}
+ </Button>
+ <Button variant="ghost" size="sm" onClick={onDone}>
+ {t('Clear')}
+ </Button>
+ <MoveAllDialog
+ group={selectAll.group}
+ overview={overview}
+ selected={selectAll.total}
+ open={movingAll}
+ onOpenChange={(open) => {
+ setMovingAll(open);
+ if (!open) onDone();
+ }}
+ />
+ </BarFrame>
+ );
+ }
+ const countOf = (list: MoveItem[]) =>
+ kind === 'project'
+ ? t('{count, plural, =1 {1 project} other {# projects}}', {
+ count: list.length,
+ })
+ : t('{count, plural, =1 {1 flow} other {# flows}}', {
+ count: list.length,
+ });
+ return (
+ <BarFrame inline={inline}>
+ <span className="text-sm text-gray-11">
+ {t('{count} selected', { count: items.length })}
+ </span>
+ {selectAll && selectAll.total > items.length && (
+ <TextLink onClick={selectAll.onToggle}>
+ {t('Select all {count, number}', { count: selectAll.total })}
+ </TextLink>
+ )}
+ <WorkerGroupSelect
+ kind={kind}
+ value={undefined}
+ inherited={null}
+ overview={overview}
+ excludeLabel={sharedFrom(items)}
+ subject={countOf(items)}
+ firstOption={
+ kind === 'flow' ? t('Back to each flow’s project group') : undefined
+ }
+ confirmEvery={(to) => {
+ const moving = items.filter((i) => i.from !== to);
+ const what = countOf(moving);
+ const flows = moving.reduce((sum, i) => sum + (i.flows ?? 0), 0);
+ return {
+ title:
+ kind === 'flow' && to === null
+ ? t('Move {what} back to their project groups?', { what })
+ : t('Move {what} to {group}?', {
+ what,
+ group: groupUtils.name(to),
+ }),
+ body:
+ [
+ kind === 'project' && flows > 0
+ ? t(
+ '{count, plural, =1 {1 flow moves with them.} other {# flows move with them.}}',
+ { count: flows },
+ )
+ : null,
+ items.length > moving.length
+ ? t(
+ '{count, plural, =1 {1 of the picked items is already on {group}.} other {# of the picked items are already on {group}.}}',
+ {
+ count: items.length - moving.length,
+ group: groupUtils.name(to),
+ },
+ )
+ : null,
+ ]
+ .filter(Boolean)
+ .join(' ') || t('You can undo this right after.'),
+ };
+ }}
+ onChange={(to) => {
+ move({ items, to })
+ .then((done) => done && onDone())
+ .catch(() => undefined);
+ }}
+ trigger={<Button size="sm">{t('Move to…')}</Button>}
+ />
+ <Button variant="ghost" size="sm" onClick={onDone}>
+ {t('Clear')}
+ </Button>
+ </BarFrame>
+ );
+}
+
+export function ProjectBadge({
+ name,
+ color,
+ size = 'sm',
+}: {
+ name: string;
+ color: string;
+ size?: BadgeSize;
+}) {
+ const palette =
+ PROJECT_COLOR_PALETTE[color as ColorName] ??
+ Object.values(PROJECT_COLOR_PALETTE)[0];
+ return (
+ <span
+ className={cn(
+ 'flex shrink-0 items-center justify-center font-semibold',
+ BADGE_SIZE[size],
+ )}
+ style={{ backgroundColor: palette.color, color: palette.textColor }}
+ >
+ {name.charAt(0).toUpperCase()}
+ </span>
+ );
+}
+
+export function FlowBadge({ size = 'sm' }: { size?: BadgeSize }) {
+ return (
+ <span
+ className={cn(
+ 'flex shrink-0 items-center justify-center bg-gray-3 text-gray-11',
+ BADGE_SIZE[size],
+ )}
+ >
+ <Workflow className={size === 'lg' ? 'size-3.5' : 'size-3'} />
+ </span>
+ );
+}
+
+const BADGE_SIZE = {
+ sm: 'size-5 rounded-md text-xs',
+ lg: 'size-8 rounded-lg text-xs',
+};
+type BadgeSize = keyof typeof BADGE_SIZE;
+
+export function Hint({
+ text,
+ children,
+}: {
+ text: string;
+ children: React.ReactElement;
+}) {
+ return (
+ <Tooltip>
+ <TooltipTrigger asChild>{children}</TooltipTrigger>
+ <TooltipContent className="max-w-xs">{text}</TooltipContent>
+ </Tooltip>
+ );
+}
+
+export function OffBadge() {
+ return (
+ <span className="shrink-0 rounded-md bg-gray-3 px-1.5 py-0.5 text-xs text-gray-11">
+ {t('Off')}
+ </span>
+ );
+}
+
+export function TextLink({
+ onClick,
+ href,
+ control,
+ children,
+}: {
+ onClick?: () => void;
+ href?: string;
+ control?: AdminControl;
+ children: React.ReactNode;
+}) {
+ const className =
+ 'font-medium text-accent-11 underline-offset-4 hover:underline';
+ if (href) {
+ return (
+ <a
+ {...adminControl(control)}
+ href={href}
+ target="_blank"
+ rel="noreferrer"
+ className={className}
+ >
+ {children}
+ </a>
+ );
+ }
+ return (
+ <button
+ {...adminControl(control)}
+ type="button"
+ onClick={onClick}
+ className={className}
+ >
+ {children}
+ </button>
+ );
+}
+
+export function modelSentence() {
+ return t(
+ 'Worker groups are servers set aside for specific projects or flows. Everything else runs on your shared workers.',
+ );
+}
+
+const NO_ACTIVE_OPTION = '__none__';
+const PICKER_SEARCH_AFTER = 7;
+
+function BarFrame({
+ inline,
+ children,
+}: {
+ inline: boolean;
+ children: React.ReactNode;
+}) {
+ return (
+ <div
+ className={cn(
+ 'flex h-12 items-center gap-3 rounded-xl border bg-(--admin-surface) pl-4 pr-2 text-sm',
+ inline ? 'shrink-0' : 'sticky bottom-6 z-40 mx-auto w-fit shadow-lg',
+ )}
+ >
+ {children}
+ </div>
+ );
+}
+
+function selectedText({
+ kind,
+ value,
+ inherited,
+}: {
+ kind: 'project' | 'flow';
+ value: string | null;
+ inherited?: string | null;
+}) {
+ return kind === 'flow' && value === null
+ ? t('Same as project ({group})', {
+ group: groupUtils.name(inherited ?? null),
+ })
+ : groupUtils.name(value);
+}
+
+function sharedFrom(items: MoveItem[]) {
+ const from = items[0]?.from;
+ return items.every((i) => i.from === from) ? from : undefined;
+}
+
+function Option({
+ title,
+ health,
+ checkable,
+ selected,
+ onSelect,
+}: {
+ title: string;
+ health: { online: number; slots: number } | null;
+ checkable: boolean;
+ selected: boolean;
+ onSelect: () => void;
+}) {
+ const down = health !== null && health.online === 0;
+ return (
+ <CommandItem value={title} onSelect={onSelect} className="gap-2 py-2">
+ {checkable && (
+ <Check
+ className={cn(
+ 'size-4 shrink-0',
+ selected ? 'opacity-100' : 'opacity-0',
+ )}
+ />
+ )}
+ <span className="flex-1 truncate">{title}</span>
+ {health !== null && (
+ <StatusDot
+ tone={down ? 'danger' : 'success'}
+ className={cn(
+ 'w-36 shrink-0 text-xs',
+ down ? 'text-danger-11' : 'text-gray-10',
+ )}
+ >
+ {down
+ ? t('No workers online')
+ : t('Concurrency {count, number}', {
+ count: health.slots,
+ })}
+ </StatusDot>
+ )}
+ </CommandItem>
+ );
+}
+
+function NoGroupsHint({
+ kind,
+ text,
+}: {
+ kind: 'project' | 'flow';
+ text?: string;
+}) {
+ return (
+ <p className="border-t px-3 py-2 text-xs text-gray-11">
+ {text ??
+ (kind === 'flow'
+ ? t(
+ 'No flow groups yet. Flow groups come from workers started for flows.',
+ )
+ : t(
+ 'No project groups yet. Project groups come from workers started for projects.',
+ ))}{' '}
+ <TextLink href={DOCS_URL}>{t('How to add one')}</TextLink>
+ </p>
+ );
+}
+
+export const DOCS_URL =
+ 'https://www.activepieces.com/docs/install/configure-operate/worker-groups';
diff --git a/packages/web/src/app/routes/platform/infra/workers/worker-groups/run-limit.tsx b/packages/web/src/app/routes/platform/infra/workers/worker-groups/run-limit.tsx
new file mode 100644
index 00000000000..7f3d64940d6
--- /dev/null
+++ b/packages/web/src/app/routes/platform/infra/workers/worker-groups/run-limit.tsx
@@ -0,0 +1,135 @@
+import { WorkerGroupProjectAssignment } from '@activepieces/shared';
+import { t } from 'i18next';
+import { Pencil } from 'lucide-react';
+import React, { useState } from 'react';
+
+import { Button } from '@/components/ui/button';
+import { Input } from '@/components/ui/input';
+import {
+ Popover,
+ PopoverContent,
+ PopoverTrigger,
+} from '@/components/ui/popover';
+import { cn } from '@/lib/utils';
+
+import { groupUtils, useRunLimit } from './hooks';
+
+export function RunLimitButton({
+ project,
+}: {
+ project: WorkerGroupProjectAssignment;
+}) {
+ const [open, setOpen] = useState(false);
+ const custom = project.maxConcurrentJobs !== null;
+ return (
+ <Popover open={open} onOpenChange={setOpen}>
+ <PopoverTrigger asChild>
+ <Button
+ variant="outline"
+ size="sm"
+ className="w-full justify-between gap-2 font-normal tabular-nums"
+ >
+ <span className={cn('truncate', !custom && 'text-gray-11')}>
+ {project.maxConcurrentJobs !== null
+ ? t('{count, number}', {
+ count: project.maxConcurrentJobs,
+ })
+ : t('Default ({count, number})', {
+ count: project.defaultMaxConcurrentJobs,
+ })}
+ </span>
+ <Pencil className="size-4 shrink-0 text-gray-10" />
+ </Button>
+ </PopoverTrigger>
+ <PopoverContent align="start" collisionPadding={16} className="w-80">
+ {open && (
+ <RunLimitForm project={project} onDone={() => setOpen(false)} />
+ )}
+ </PopoverContent>
+ </Popover>
+ );
+}
+
+function RunLimitForm({
+ project,
+ onDone,
+}: {
+ project: WorkerGroupProjectAssignment;
+ onDone: () => void;
+}) {
+ const [value, setValue] = useState(
+ project.maxConcurrentJobs === null ? '' : String(project.maxConcurrentJobs),
+ );
+ const { mutate, isPending } = useRunLimit();
+ const trimmed = value.trim();
+ const parsed = trimmed === '' ? null : Number(trimmed);
+ const invalid = parsed !== null && (!Number.isInteger(parsed) || parsed < 1);
+
+ const save = (maxConcurrentJobs: number | null) => {
+ if (maxConcurrentJobs === project.maxConcurrentJobs) {
+ onDone();
+ return;
+ }
+ mutate({ projectId: project.id, maxConcurrentJobs }, { onSuccess: onDone });
+ };
+
+ return (
+ <form
+ className="flex flex-col gap-3"
+ onSubmit={(e) => {
+ e.preventDefault();
+ if (!invalid && !isPending) save(parsed);
+ }}
+ >
+ <div className="flex flex-col gap-1">
+ <label htmlFor="run-limit" className="text-sm font-medium text-gray-12">
+ {t('Concurrency limit')}
+ </label>
+ <p className="text-sm text-gray-11">
+ {t(
+ 'How many runs of {project} can go at the same time. Extra runs wait their turn.',
+ {
+ project: groupUtils.quote(project.displayName),
+ },
+ )}
+ </p>
+ </div>
+ <Input
+ id="run-limit"
+ inputMode="numeric"
+ autoFocus
+ value={value}
+ aria-invalid={invalid}
+ aria-describedby="run-limit-help"
+ placeholder={t('Default ({count, number})', {
+ count: project.defaultMaxConcurrentJobs,
+ })}
+ onChange={(e) => setValue(e.target.value.replace(/[^0-9]/g, ''))}
+ />
+ <p
+ id="run-limit-help"
+ className={cn(
+ 'min-h-8 text-xs',
+ invalid ? 'text-danger-11' : 'text-gray-11',
+ )}
+ >
+ {invalid
+ ? t('Enter a whole number above 0.')
+ : t(
+ 'Leave it empty to use the default, {count, number}. The default comes from your plan and the group’s capacity.',
+ {
+ count: project.defaultMaxConcurrentJobs,
+ },
+ )}
+ </p>
+ <div className="flex justify-end gap-2">
+ <Button type="button" variant="ghost" size="sm" onClick={onDone}>
+ {t('Cancel')}
+ </Button>
+ <Button type="submit" size="sm" disabled={invalid} loading={isPending}>
+ {t('Save')}
+ </Button>
+ </div>
+ </form>
+ );
+}
diff --git a/packages/web/src/app/routes/platform/infra/workers/worker-groups/search-results.tsx b/packages/web/src/app/routes/platform/infra/workers/worker-groups/search-results.tsx
new file mode 100644
index 00000000000..093adc9f31a
--- /dev/null
+++ b/packages/web/src/app/routes/platform/infra/workers/worker-groups/search-results.tsx
@@ -0,0 +1,329 @@
+import {
+ WorkerGroupFlowAssignment,
+ WorkerGroupProjectAssignment,
+ WorkerGroupsOverview,
+} from '@activepieces/shared';
+import { t } from 'i18next';
+import React, { useState } from 'react';
+
+import { StatusDot, adminSurface } from '@/app/components/admin';
+import { DataFetchErrorState } from '@/components/custom/data-fetch-error-state';
+import { Button } from '@/components/ui/button';
+import { cn } from '@/lib/utils';
+
+import { groupUtils, useMover, workerGroupsQueries } from './hooks';
+import {
+ FlowBadge,
+ OffBadge,
+ Pager,
+ ProjectBadge,
+ WorkerGroupSelect,
+} from './parts';
+
+export function SearchResults({
+ overview,
+ query,
+ fallback,
+}: {
+ overview: WorkerGroupsOverview | undefined;
+ query: string;
+ fallback: React.ReactNode;
+}) {
+ const projectPages = usePages(query);
+ const flowPages = usePages(query);
+ const projects = workerGroupsQueries.useSearch({
+ kind: 'project',
+ query,
+ cursor: projectPages.cursor,
+ });
+ const flows = workerGroupsQueries.useSearch({
+ kind: 'flow',
+ query,
+ cursor: flowPages.cursor,
+ });
+ if (!projects.data || !flows.data) {
+ if (projects.isError || flows.isError) {
+ return (
+ <DataFetchErrorState
+ entity={t('search results')}
+ onRetry={() => {
+ projects.refetch();
+ flows.refetch();
+ }}
+ />
+ );
+ }
+ return <>{fallback}</>;
+ }
+ const total = projects.data.total + flows.data.total;
+ if (total === 0) {
+ return (
+ <p className="text-sm text-gray-11">
+ {t('Nothing matches {query}.', {
+ query: groupUtils.quote(query.trim()),
+ })}
+ </p>
+ );
+ }
+ return (
+ <div className="flex flex-col gap-6">
+ <p className="text-sm text-gray-11">
+ {t('{count, plural, =1 {1 result} other {{countText} results}}', {
+ count: total,
+ countText: total.toLocaleString(),
+ })}
+ </p>
+ {projects.data.total > 0 && (
+ <ResultSection
+ title={t('Projects')}
+ page={projects.data}
+ onCursor={projectPages.setCursor}
+ >
+ {(projects.data.data as WorkerGroupProjectAssignment[]).map(
+ (project) => (
+ <ProjectResult
+ key={project.id}
+ project={project}
+ overview={overview}
+ />
+ ),
+ )}
+ </ResultSection>
+ )}
+ {flows.data.total > 0 && (
+ <ResultSection
+ title={t('Flows')}
+ page={flows.data}
+ onCursor={flowPages.setCursor}
+ >
+ {(flows.data.data as WorkerGroupFlowAssignment[]).map((flow) => (
+ <FlowResult key={flow.id} flow={flow} overview={overview} />
+ ))}
+ </ResultSection>
+ )}
+ </div>
+ );
+}
+
+function usePages(query: string) {
+ const [state, setState] = useState<{
+ query: string;
+ cursor: string | undefined;
+ }>({ query, cursor: undefined });
+ return {
+ cursor: state.query === query ? state.cursor : undefined,
+ setCursor: (cursor: string | undefined) => setState({ query, cursor }),
+ };
+}
+
+function ResultSection({
+ title,
+ page,
+ onCursor,
+ children,
+}: {
+ title: string;
+ page: {
+ offset: number;
+ total: number;
+ data: unknown[];
+ next: string | null;
+ previous: string | null;
+ };
+ onCursor: (cursor: string | undefined) => void;
+ children: React.ReactNode;
+}) {
+ return (
+ <section className="flex flex-col gap-2">
+ <div className="flex h-8 items-center justify-between gap-3">
+ <h3 className="flex items-baseline gap-2 text-sm font-medium text-gray-12">
+ {title}
+ {page.total <= page.data.length && (
+ <span className="font-normal tabular-nums text-gray-10">
+ {page.total.toLocaleString()}
+ </span>
+ )}
+ </h3>
+ <Pager
+ offset={page.offset}
+ count={page.data.length}
+ total={page.total}
+ onPrevious={
+ page.previous !== null
+ ? () => onCursor(page.previous ?? undefined)
+ : undefined
+ }
+ onNext={
+ page.next !== null
+ ? () => onCursor(page.next ?? undefined)
+ : undefined
+ }
+ />
+ </div>
+ <ResultList>{children}</ResultList>
+ </section>
+ );
+}
+
+function ProjectResult({
+ project,
+ overview,
+}: {
+ project: WorkerGroupProjectAssignment;
+ overview: WorkerGroupsOverview | undefined;
+}) {
+ const { move } = useMover();
+ return (
+ <ResultRow
+ icon={
+ <ProjectBadge
+ name={project.displayName}
+ color={project.color}
+ size="lg"
+ />
+ }
+ down={
+ groupUtils.find({
+ overview,
+ label: project.workerGroupId,
+ scope: 'project',
+ })?.online === 0
+ }
+ sentence={
+ <>
+ <b className="font-medium text-gray-12">{project.displayName}</b>{' '}
+ {t('runs on')}{' '}
+ <b className="font-medium text-gray-12">
+ {groupUtils.name(project.workerGroupId)}
+ </b>
+ </>
+ }
+ action={
+ <WorkerGroupSelect
+ kind="project"
+ value={project.workerGroupId}
+ overview={overview}
+ subject={project.displayName}
+ align="end"
+ onChange={(to) => {
+ move({
+ items: [
+ {
+ kind: 'project',
+ id: project.id,
+ from: project.workerGroupId,
+ },
+ ],
+ to,
+ }).catch(() => undefined);
+ }}
+ trigger={
+ <Button variant="outline" size="sm">
+ {t('Change')}
+ </Button>
+ }
+ />
+ }
+ />
+ );
+}
+
+function FlowResult({
+ flow,
+ overview,
+}: {
+ flow: WorkerGroupFlowAssignment;
+ overview: WorkerGroupsOverview | undefined;
+}) {
+ const { move } = useMover();
+ return (
+ <ResultRow
+ icon={<FlowBadge size="lg" />}
+ down={
+ groupUtils.find({
+ overview,
+ label: flow.effective,
+ scope: flow.workerGroupId === null ? 'project' : 'flow',
+ })?.online === 0
+ }
+ sentence={
+ <>
+ <b className="font-medium text-gray-12">{flow.displayName}</b>{' '}
+ {!flow.enabled && <OffBadge />}{' '}
+ {t('in {project} runs on', { project: flow.projectName })}{' '}
+ <b className="font-medium text-gray-12">
+ {groupUtils.name(flow.effective)}
+ </b>
+ {flow.workerGroupId === null && (
+ <span className="text-gray-10"> {t('(the project’s group)')}</span>
+ )}
+ </>
+ }
+ action={
+ <WorkerGroupSelect
+ kind="flow"
+ value={flow.workerGroupId}
+ inherited={flow.inherited}
+ overview={overview}
+ subject={flow.displayName}
+ align="end"
+ onChange={(to) => {
+ move({
+ items: [{ kind: 'flow', id: flow.id, from: flow.workerGroupId }],
+ to,
+ }).catch(() => undefined);
+ }}
+ trigger={
+ <Button variant="outline" size="sm">
+ {t('Change')}
+ </Button>
+ }
+ />
+ }
+ />
+ );
+}
+
+function ResultList({ children }: { children: React.ReactNode }) {
+ return (
+ <div
+ className={cn(
+ adminSurface.listFrame,
+ adminSurface.divider,
+ 'flex flex-col divide-y',
+ )}
+ >
+ {children}
+ </div>
+ );
+}
+
+function ResultRow({
+ icon,
+ sentence,
+ down,
+ action,
+}: {
+ icon: React.ReactNode;
+ sentence: React.ReactNode;
+ down: boolean;
+ action: React.ReactNode;
+}) {
+ return (
+ <div className="flex min-h-14 items-center gap-3 px-4 py-2">
+ {icon}
+ <p className="min-w-0 flex-1 text-sm text-gray-11">
+ {sentence}
+ {down && (
+ <StatusDot
+ tone="danger"
+ className="ml-2 inline-flex text-xs text-danger-11"
+ >
+ {t('No workers online')}
+ </StatusDot>
+ )}
+ </p>
+ <span className="shrink-0">{action}</span>
+ </div>
+ );
+}
diff --git a/packages/web/src/app/routes/platform/infra/workers/worker-groups/setup-guide.tsx b/packages/web/src/app/routes/platform/infra/workers/worker-groups/setup-guide.tsx
new file mode 100644
index 00000000000..964914bec85
--- /dev/null
+++ b/packages/web/src/app/routes/platform/infra/workers/worker-groups/setup-guide.tsx
@@ -0,0 +1,97 @@
+import { t } from 'i18next';
+import React from 'react';
+
+import { adminSurface } from '@/app/components/admin';
+import { Button } from '@/components/ui/button';
+import { AdminControl, adminControl } from '@/lib/admin-control';
+import { cn } from '@/lib/utils';
+
+import { DOCS_URL } from './parts';
+
+export function NoGroupsGuide() {
+ return (
+ <div className={cn(adminSurface.card, 'flex flex-col gap-6 p-5')}>
+ <section className="flex max-w-2xl flex-col gap-2">
+ <h2 className="text-lg font-semibold text-gray-12">
+ {t('You have no worker groups yet')}
+ </h2>
+ <p className="text-sm text-gray-11">
+ {t(
+ 'Right now every project and flow runs on your shared workers. That is fine for most teams.',
+ )}
+ </p>
+ </section>
+ <section className="flex max-w-2xl flex-col gap-2">
+ <h3 className="text-sm font-medium text-gray-12">
+ {t('When a group helps')}
+ </h3>
+ <ul className="flex list-disc flex-col gap-1 pl-5 text-sm text-gray-11">
+ <li>
+ {t(
+ 'A busy project slows the others down. Give it its own servers.',
+ )}
+ </li>
+ <li>
+ {t(
+ 'A few flows need more memory or a GPU. Send just those flows to bigger servers.',
+ )}
+ </li>
+ <li>
+ {t(
+ 'A project must run in one region or network. Keep it on servers there.',
+ )}
+ </li>
+ </ul>
+ </section>
+ <section className="flex max-w-2xl flex-col gap-2">
+ <h3 className="text-sm font-medium text-gray-12">
+ {t('How to add one')}
+ </h3>
+ <SetupSteps />
+ </section>
+ <div>
+ <Button variant="outline" asChild>
+ <a
+ {...adminControl(AdminControl.WORKERS_DOCS_LINK)}
+ href={DOCS_URL}
+ target="_blank"
+ rel="noreferrer"
+ >
+ {t('Read the guide')}
+ </a>
+ </Button>
+ </div>
+ </div>
+ );
+}
+
+function SetupSteps() {
+ return (
+ <ol className="flex list-decimal flex-col gap-1.5 pl-5 text-sm text-gray-11">
+ <li>
+ {t('Start one or more workers with')}{' '}
+ <Code>AP_WORKER_GROUP_ID=finance_eu</Code>
+ {t(', using your own group name.')}
+ </li>
+ <li>
+ {t(
+ 'For a group that runs single flows instead of whole projects, also set',
+ )}{' '}
+ <Code>AP_WORKER_GROUP_SCOPE=flow</Code>.
+ </li>
+ <li>
+ {t(
+ 'The group shows up here once a worker is online. Then add projects or flows to it.',
+ )}
+ </li>
+ </ol>
+ );
+}
+
+function Code({ children }: { children: React.ReactNode }) {
+ return (
+ <code className="rounded bg-gray-3 px-1 py-0.5 font-mono text-xs text-gray-12">
+ {children}
+ </code>
+ );
+}
diff --git a/packages/web/src/app/routes/platform/infra/workers/worker-groups/tables.tsx b/packages/web/src/app/routes/platform/infra/workers/worker-groups/tables.tsx
new file mode 100644
index 00000000000..559d054c913
--- /dev/null
+++ b/packages/web/src/app/routes/platform/infra/workers/worker-groups/tables.tsx
@@ -0,0 +1,801 @@
+import {
+ WorkerGroupFlowAssignment,
+ WorkerGroupProjectAssignment,
+ WorkerGroupsOverview,
+} from '@activepieces/shared';
+import { t } from 'i18next';
+import React, { useEffect, useRef, useState } from 'react';
+
+import { StatusDot, adminSurface } from '@/app/components/admin';
+import { DataFetchErrorState } from '@/components/custom/data-fetch-error-state';
+import { TextWithTooltip } from '@/components/custom/text-with-tooltip';
+import { Button } from '@/components/ui/button';
+import { Checkbox } from '@/components/ui/checkbox';
+import { Skeleton } from '@/components/ui/skeleton';
+import {
+ Table,
+ TableBody,
+ TableCell,
+ TableHead,
+ TableHeader,
+ TableRow,
+} from '@/components/ui/table';
+import { cn } from '@/lib/utils';
+
+import { MoveItem, groupUtils, useMover, workerGroupsQueries } from './hooks';
+import {
+ FlowBadge,
+ Hint,
+ OffBadge,
+ Pager,
+ ProjectBadge,
+ SearchBox,
+ SelectionBar,
+ WorkerGroupSelect,
+} from './parts';
+import { RunLimitButton } from './run-limit';
+
+export function ProjectsTable({
+ overview,
+ label,
+ search,
+ onSearchChange,
+ cursor,
+ onCursorChange,
+ onOpenFlows,
+ emptyText,
+ showRunLimit,
+ showRemove = false,
+}: {
+ overview: WorkerGroupsOverview | undefined;
+ label: string | null;
+ search: string;
+ onSearchChange: (value: string) => void;
+ cursor: string | undefined;
+ onCursorChange: (cursor: string | undefined) => void;
+ onOpenFlows: (project: WorkerGroupProjectAssignment) => void;
+ emptyText: string;
+ showRunLimit: boolean;
+ showRemove?: boolean;
+}) {
+ const selection = useSelection('project');
+ const query = workerGroupsQueries.useProjects({
+ params: {
+ ...groupUtils.projectListParams(label),
+ search: search || undefined,
+ cursor,
+ },
+ });
+ const page = query.data;
+ const topRef = useScrollTopOnPage(page?.offset);
+ const columns = showRunLimit ? 6 : 5;
+ const rows = page?.data ?? [];
+ const groupSummary = groupUtils.find({
+ overview,
+ label,
+ scope: 'project',
+ });
+ return (
+ <div ref={topRef} className="flex scroll-mt-4 flex-col gap-3">
+ <SearchBox
+ value={search}
+ onChange={onSearchChange}
+ placeholder={t('Search projects')}
+ />
+ <Frame>
+ <Table className="table-fixed max-md:w-[980px] [&_td:last-child]:pr-4 [&_th:last-child]:pr-4">
+ <TableHeader>
+ <TableRow className="hover:bg-transparent">
+ <TableHead className="w-12">
+ <PageCheckbox
+ selection={selection}
+ rows={rows.map(projectSelectable)}
+ />
+ </TableHead>
+ <TableHead>{t('Project')}</TableHead>
+ <TableHead className="w-16">{t('Flows')}</TableHead>
+ <TableHead className="w-56">{t('Worker group')}</TableHead>
+ {showRunLimit && (
+ <TableHead className="w-48">
+ <Hint
+ text={t(
+ 'The most runs of one project at the same time. Flows with their own group are not limited by it. Extra runs wait their turn.',
+ )}
+ >
+ <span>{t('Concurrency limit')}</span>
+ </Hint>
+ </TableHead>
+ )}
+ <TableHead className={showRemove ? 'w-56' : 'w-36'} />
+ </TableRow>
+ </TableHeader>
+ <TableBody>
+ {query.isError && (
+ <ErrorRow
+ columns={columns}
+ entity={t('projects')}
+ onRetry={() => query.refetch()}
+ />
+ )}
+ {query.isLoading && (
+ <SkeletonRows
+ columns={columns}
+ rows={Math.min(
+ groupSummary?.projectCount ??
+ (label === null
+ ? overview?.defaultGroup.projectCount
+ : undefined) ??
+ SKELETON_ROWS,
+ SKELETON_ROWS,
+ )}
+ />
+ )}
+ {rows.map((row) => (
+ <ProjectRow
+ key={row.id}
+ project={row}
+ overview={overview}
+ selected={selection.has(row.id)}
+ onToggle={() => selection.toggle(projectSelectable(row))}
+ onMoved={() => selection.drop(row.id)}
+ showRunLimit={showRunLimit}
+ showRemove={showRemove}
+ onOpenFlows={onOpenFlows}
+ />
+ ))}
+ {page && rows.length === 0 && (
+ <EmptyRow
+ columns={columns}
+ text={search ? t('No projects match your search.') : emptyText}
+ />
+ )}
+ </TableBody>
+ </Table>
+ </Frame>
+ {page && (
+ <Pager
+ offset={page.offset}
+ count={rows.length}
+ total={page.total}
+ onPrevious={
+ page.previous !== null
+ ? () => onCursorChange(page.previous ?? undefined)
+ : undefined
+ }
+ onNext={
+ page.next !== null
+ ? () => onCursorChange(page.next ?? undefined)
+ : undefined
+ }
+ />
+ )}
+ <SelectionBar
+ items={selection.items}
+ kind="project"
+ overview={overview}
+ onDone={selection.clear}
+ selectAll={
+ groupSummary && !search && page && page.total > rows.length
+ ? {
+ total: page.total,
+ group: groupSummary,
+ active: selection.all,
+ onToggle: selection.selectAll,
+ }
+ : undefined
+ }
+ />
+ </div>
+ );
+}
+
+export function FlowsTable({
+ overview,
+ group,
+ projectId,
+ emptyText,
+ scrollBody = false,
+ footerAction,
+ showRemove = false,
+ expectedRows,
+}: {
+ overview: WorkerGroupsOverview | undefined;
+ group?: string;
+ projectId?: string;
+ emptyText: string;
+ scrollBody?: boolean;
+ footerAction?: React.ReactNode;
+ showRemove?: boolean;
+ expectedRows?: number;
+}) {
+ const [search, setSearch] = useState('');
+ const [cursor, setCursor] = useState<string | undefined>(undefined);
+ const selection = useSelection('flow');
+ const query = workerGroupsQueries.useFlows({
+ params: { group, projectId, search: search || undefined, cursor },
+ });
+ const page = query.data;
+ const showProject = projectId === undefined;
+ const columns = (showProject ? 4 : 3) + (showRemove ? 1 : 0);
+ const rows = page?.data ?? [];
+ const groupSummary = groupUtils.find({
+ overview,
+ label: group ?? null,
+ scope: 'flow',
+ });
+ return (
+ <div className={cn('flex flex-col gap-3', scrollBody && 'min-h-0 flex-1')}>
+ <SearchBox
+ value={search}
+ onChange={(value) => {
+ setSearch(value);
+ setCursor(undefined);
+ }}
+ placeholder={t('Search flows')}
+ />
+ <div
+ className={cn(
+ scrollBody && 'min-h-0 flex-1 overflow-y-auto rounded-xl border-y',
+ )}
+ >
+ <Frame>
+ <Table
+ className={cn(
+ 'table-fixed [&_td:last-child]:pr-4 [&_th:last-child]:pr-4',
+ !scrollBody && 'max-md:w-[980px]',
+ )}
+ >
+ <TableHeader>
+ <TableRow className="hover:bg-transparent">
+ <TableHead className="w-12">
+ <PageCheckbox
+ selection={selection}
+ rows={rows.map(flowSelectable)}
+ />
+ </TableHead>
+ <TableHead>{t('Flow')}</TableHead>
+ {showProject && (
+ <TableHead className="w-56">{t('Project')}</TableHead>
+ )}
+ <TableHead
+ className={scrollBody ? 'w-72 max-sm:hidden' : 'w-56'}
+ >
+ {t('Worker group')}
+ </TableHead>
+ {showRemove && <TableHead className="w-28" />}
+ </TableRow>
+ </TableHeader>
+ <TableBody>
+ {query.isError && (
+ <ErrorRow
+ columns={columns}
+ entity={t('flows')}
+ onRetry={() => query.refetch()}
+ />
+ )}
+ {query.isLoading && (
+ <SkeletonRows columns={columns} rows={expectedRows} />
+ )}
+ {rows.map((row) => (
+ <FlowRow
+ key={row.id}
+ flow={row}
+ overview={overview}
+ selected={selection.has(row.id)}
+ onToggle={() => selection.toggle(flowSelectable(row))}
+ onMoved={() => selection.drop(row.id)}
+ showProject={showProject}
+ showRemove={showRemove}
+ stacked={scrollBody}
+ />
+ ))}
+ {page && rows.length === 0 && (
+ <EmptyRow
+ columns={columns}
+ text={search ? t('No flows match your search.') : emptyText}
+ />
+ )}
+ </TableBody>
+ </Table>
+ </Frame>
+ </div>
+ {(page || footerAction) && (
+ <div
+ className={cn(
+ 'flex items-center gap-4',
+ footerAction ? 'justify-between' : 'justify-end',
+ )}
+ >
+ {page && (
+ <Pager
+ offset={page.offset}
+ count={rows.length}
+ total={page.total}
+ noun={scrollBody ? t('flows') : undefined}
+ onPrevious={
+ page.previous !== null
+ ? () => setCursor(page.previous ?? undefined)
+ : undefined
+ }
+ onNext={
+ page.next !== null
+ ? () => setCursor(page.next ?? undefined)
+ : undefined
+ }
+ />
+ )}
+ {footerAction}
+ </div>
+ )}
+ <SelectionBar
+ items={selection.items}
+ kind="flow"
+ overview={overview}
+ inline={scrollBody}
+ onDone={selection.clear}
+ selectAll={
+ groupSummary && !search && page && page.total > rows.length
+ ? {
+ total: page.total,
+ group: groupSummary,
+ active: selection.all,
+ onToggle: selection.selectAll,
+ }
+ : undefined
+ }
+ />
+ </div>
+ );
+}
+
+export function ProjectRow({
+ project,
+ overview,
+ selected,
+ onToggle,
+ onMoved,
+ showRunLimit,
+ showRemove,
+ onOpenFlows,
+}: {
+ project: WorkerGroupProjectAssignment;
+ overview: WorkerGroupsOverview | undefined;
+ selected: boolean;
+ onToggle: () => void;
+ onMoved: () => void;
+ showRunLimit: boolean;
+ showRemove: boolean;
+ onOpenFlows: (project: WorkerGroupProjectAssignment) => void;
+}) {
+ const { move } = useMover();
+ const moveTo = (to: string | null) => {
+ move({
+ items: [{ kind: 'project', id: project.id, from: project.workerGroupId }],
+ to,
+ })
+ .then((moved) => moved && onMoved())
+ .catch(() => undefined);
+ };
+ return (
+ <TableRow className="h-14 hover:bg-transparent">
+ <TableCell>
+ <Checkbox
+ checked={selected}
+ onCheckedChange={onToggle}
+ aria-label={t('Select {name}', { name: project.displayName })}
+ />
+ </TableCell>
+ <TableCell>
+ <span className="flex min-w-0 items-center gap-3">
+ <ProjectBadge
+ name={project.displayName}
+ color={project.color}
+ size="lg"
+ />
+ <span className="flex min-w-0 flex-col">
+ <TextWithTooltip tooltipMessage={project.displayName}>
+ <span className="font-medium text-gray-12">
+ {project.displayName}
+ </span>
+ </TextWithTooltip>
+ <PinnedFlowsLine overview={overview} project={project} />
+ </span>
+ </span>
+ </TableCell>
+ <TableCell className="tabular-nums text-gray-11">
+ {project.flowCount}
+ </TableCell>
+ <TableCell>
+ <WorkerGroupSelect
+ kind="project"
+ value={project.workerGroupId}
+ overview={overview}
+ subject={project.displayName}
+ detail={projectDetail(project)}
+ onChange={moveTo}
+ />
+ </TableCell>
+ {showRunLimit && (
+ <TableCell>
+ <RunLimitButton project={project} />
+ </TableCell>
+ )}
+ <TableCell>
+ <span className="flex items-center justify-end gap-2">
+ <Button
+ variant="outline"
+ size="sm"
+ disabled={project.flowCount === 0}
+ onClick={() => onOpenFlows(project)}
+ >
+ {t('View flows')}
+ </Button>
+ {showRemove && project.workerGroupId !== null && (
+ <Button variant="ghost" size="sm" onClick={() => moveTo(null)}>
+ {t('Remove')}
+ </Button>
+ )}
+ </span>
+ </TableCell>
+ </TableRow>
+ );
+}
+
+export function FlowRow({
+ flow,
+ overview,
+ selected,
+ onToggle,
+ onMoved,
+ showProject,
+ showRemove,
+ stacked,
+}: {
+ flow: WorkerGroupFlowAssignment;
+ overview: WorkerGroupsOverview | undefined;
+ selected: boolean;
+ onToggle: () => void;
+ onMoved: () => void;
+ showProject: boolean;
+ showRemove: boolean;
+ stacked: boolean;
+}) {
+ const { move } = useMover();
+ const moveTo = (to: string | null) => {
+ move({
+ items: [{ kind: 'flow', id: flow.id, from: flow.workerGroupId }],
+ to,
+ })
+ .then((moved) => moved && onMoved())
+ .catch(() => undefined);
+ };
+ const picker = (
+ <WorkerGroupSelect
+ kind="flow"
+ value={flow.workerGroupId}
+ inherited={flow.inherited}
+ overview={overview}
+ subject={flow.displayName}
+ align="end"
+ onChange={moveTo}
+ />
+ );
+ return (
+ <TableRow className="h-14 hover:bg-transparent">
+ <TableCell>
+ <Checkbox
+ checked={selected}
+ onCheckedChange={onToggle}
+ aria-label={t('Select {name}', { name: flow.displayName })}
+ />
+ </TableCell>
+ <TableCell>
+ <span className="flex min-w-0 items-center gap-3">
+ <span className={cn('shrink-0', stacked && 'max-sm:hidden')}>
+ <FlowBadge size="lg" />
+ </span>
+ <span className="flex min-w-0 flex-1 flex-col gap-1.5">
+ <span className="flex min-w-0 items-center gap-2">
+ <TextWithTooltip tooltipMessage={flow.displayName}>
+ <span
+ className={cn(
+ 'font-medium',
+ flow.enabled ? 'text-gray-12' : 'text-gray-10',
+ )}
+ >
+ {flow.displayName}
+ </span>
+ </TextWithTooltip>
+ {!flow.enabled && <OffBadge />}
+ </span>
+ {stacked && <span className="sm:hidden">{picker}</span>}
+ </span>
+ </span>
+ </TableCell>
+ {showProject && (
+ <TableCell>
+ <span className="flex min-w-0 items-center gap-3 text-gray-11">
+ <ProjectBadge
+ name={flow.projectName}
+ color={flow.projectColor}
+ size="lg"
+ />
+ <span className="flex min-w-0 flex-col">
+ <TextWithTooltip tooltipMessage={flow.projectName}>
+ <span>{flow.projectName}</span>
+ </TextWithTooltip>
+ </span>
+ </span>
+ </TableCell>
+ )}
+ <TableCell className={cn(stacked && 'max-sm:hidden')}>{picker}</TableCell>
+ {showRemove && (
+ <TableCell className="text-right">
+ {flow.workerGroupId !== null && (
+ <Button variant="ghost" size="sm" onClick={() => moveTo(null)}>
+ {t('Remove')}
+ </Button>
+ )}
+ </TableCell>
+ )}
+ </TableRow>
+ );
+}
+
+export function Frame({ children }: { children: React.ReactNode }) {
+ return (
+ <div className={cn(adminSurface.listFrame, 'overflow-x-auto')}>
+ {children}
+ </div>
+ );
+}
+
+function projectSelectable(row: WorkerGroupProjectAssignment): SelectableRow {
+ return {
+ id: row.id,
+ from: row.workerGroupId,
+ flows: row.flowCount - row.flowsElsewhere,
+ };
+}
+
+function flowSelectable(row: WorkerGroupFlowAssignment): SelectableRow {
+ return { id: row.id, from: row.workerGroupId };
+}
+
+function PageCheckbox({
+ selection,
+ rows,
+}: {
+ selection: Selection;
+ rows: SelectableRow[];
+}) {
+ const selectedOnPage = rows.filter((r) => selection.has(r.id)).length;
+ const state =
+ rows.length > 0 && selectedOnPage === rows.length
+ ? true
+ : selectedOnPage > 0
+ ? 'indeterminate'
+ : false;
+ return (
+ <Checkbox
+ checked={state}
+ disabled={rows.length === 0}
+ onCheckedChange={() =>
+ state === true ? selection.removePage(rows) : selection.addPage(rows)
+ }
+ aria-label={t('Select all on this page')}
+ />
+ );
+}
+
+function useSelection(kind: 'project' | 'flow'): Selection {
+ const [items, setItems] = useState<MoveItem[]>([]);
+ const [all, setAll] = useState(false);
+ return {
+ items,
+ all,
+ has: (id) => items.some((i) => i.id === id),
+ toggle: ({ id, from, flows }) => {
+ setAll(false);
+ setItems((prev) =>
+ prev.some((i) => i.id === id)
+ ? prev.filter((i) => i.id !== id)
+ : [...prev, { kind, id, from, flows }],
+ );
+ },
+ addPage: (rows) => {
+ setAll(false);
+ const ids = new Set(rows.map((r) => r.id));
+ setItems((prev) => [
+ ...prev.filter((i) => !ids.has(i.id)),
+ ...rows.map((r) => ({ kind, id: r.id, from: r.from, flows: r.flows })),
+ ]);
+ },
+ removePage: (rows) => {
+ setAll(false);
+ const ids = new Set(rows.map((r) => r.id));
+ setItems((prev) => prev.filter((i) => !ids.has(i.id)));
+ },
+ drop: (id) => {
+ setAll(false);
+ setItems((prev) => prev.filter((i) => i.id !== id));
+ },
+ selectAll: () => setAll(true),
+ clear: () => {
+ setAll(false);
+ setItems([]);
+ },
+ };
+}
+
+function PinnedFlowsLine({
+ overview,
+ project,
+}: {
+ overview: WorkerGroupsOverview | undefined;
+ project: WorkerGroupProjectAssignment;
+}) {
+ if (project.pinnedFlows.length === 0) return null;
+ const stuck = project.pinnedFlows.some(
+ (p) =>
+ groupUtils.find({
+ overview,
+ label: p.workerGroupId,
+ scope: 'flow',
+ })?.online === 0,
+ );
+ const text =
+ project.pinnedFlows.length === 1
+ ? t(
+ '{count, plural, =1 {1 flow runs on {group}} other {# flows run on {group}}}',
+ {
+ count: project.pinnedFlows[0].count,
+ group: groupUtils.name(project.pinnedFlows[0].workerGroupId),
+ },
+ )
+ : t(
+ '{count, plural, =1 {1 flow runs on another group} other {# flows run on other groups}}',
+ {
+ count: project.flowsElsewhere,
+ },
+ );
+ const line = (
+ <span className="flex min-w-0 items-center gap-1.5 text-xs text-gray-11">
+ {stuck && <StatusDot tone="danger" />}
+ <span className="truncate">{text}</span>
+ </span>
+ );
+ if (project.pinnedFlows.length === 1 && !stuck) return line;
+ return (
+ <Hint
+ text={project.pinnedFlows
+ .map((p) =>
+ groupUtils.find({
+ overview,
+ label: p.workerGroupId,
+ scope: 'flow',
+ })?.online === 0
+ ? t(
+ '{count, plural, =1 {1 flow} other {# flows}} on {group}, which has no workers online',
+ {
+ count: p.count,
+ group: groupUtils.name(p.workerGroupId),
+ },
+ )
+ : t('{count, plural, =1 {1 flow} other {# flows}} on {group}', {
+ count: p.count,
+ group: groupUtils.name(p.workerGroupId),
+ }),
+ )
+ .join(' · ')}
+ >
+ {line}
+ </Hint>
+ );
+}
+
+function projectDetail(row: WorkerGroupProjectAssignment) {
+ const moving = row.flowCount - row.flowsElsewhere;
+ return row.flowsElsewhere > 0
+ ? t(
+ '{count, plural, =1 {1 flow moves} other {# flows move}}; {kept, plural, =1 {1 keeps its own group.} other {# keep their own group.}}',
+ {
+ count: moving,
+ kept: row.flowsElsewhere,
+ },
+ )
+ : t(
+ '{count, plural, =1 {Its 1 flow moves too.} other {Its # flows move too.}}',
+ { count: moving },
+ );
+}
+
+function ErrorRow({
+ columns,
+ entity,
+ onRetry,
+}: {
+ columns: number;
+ entity: string;
+ onRetry: () => void;
+}) {
+ return (
+ <TableRow className="hover:bg-transparent">
+ <TableCell colSpan={columns}>
+ <DataFetchErrorState entity={entity} onRetry={onRetry} />
+ </TableCell>
+ </TableRow>
+ );
+}
+
+function SkeletonRows({
+ columns,
+ rows = SKELETON_ROWS,
+}: {
+ columns: number;
+ rows?: number;
+}) {
+ return (
+ <>
+ {Array.from({ length: rows }, (_, r) => (
+ <TableRow key={r} className="h-14 hover:bg-transparent">
+ <TableCell>
+ <Skeleton className="size-4 rounded" />
+ </TableCell>
+ <TableCell>
+ <span className="flex items-center gap-3">
+ <Skeleton className="size-8 shrink-0 rounded-lg" />
+ <Skeleton className="h-4 w-1/2" />
+ </span>
+ </TableCell>
+ {Array.from({ length: columns - 2 }, (_, c) => (
+ <TableCell key={c}>
+ <Skeleton className="h-4 w-3/4" />
+ </TableCell>
+ ))}
+ </TableRow>
+ ))}
+ </>
+ );
+}
+
+function EmptyRow({ columns, text }: { columns: number; text: string }) {
+ return (
+ <TableRow className="hover:bg-transparent">
+ <TableCell colSpan={columns} className="h-24 text-center text-gray-10">
+ {text}
+ </TableCell>
+ </TableRow>
+ );
+}
+
+const SKELETON_ROWS = 10;
+
+type Selection = {
+ items: MoveItem[];
+ all: boolean;
+ has: (id: string) => boolean;
+ toggle: (row: SelectableRow) => void;
+ addPage: (rows: SelectableRow[]) => void;
+ removePage: (rows: SelectableRow[]) => void;
+ drop: (id: string) => void;
+ selectAll: () => void;
+ clear: () => void;
+};
+
+type SelectableRow = { id: string; from: string | null; flows?: number };
+
+function useScrollTopOnPage(offset: number | undefined) {
+ const ref = useRef<HTMLDivElement>(null);
+ const previous = useRef(offset);
+ useEffect(() => {
+ if (offset === undefined || previous.current === offset) return;
+ const changed = previous.current !== undefined;
+ previous.current = offset;
+ const el = ref.current;
+ if (changed && el && el.getBoundingClientRect().top < 0) {
+ el.scrollIntoView({ block: 'start' });
+ }
+ }, [offset]);
+ return ref;
+}
diff --git a/packages/web/src/app/routes/platform/infra/workers/worker-groups/worker-groups-page.tsx b/packages/web/src/app/routes/platform/infra/workers/worker-groups/worker-groups-page.tsx
new file mode 100644
index 00000000000..75433c92b7c
--- /dev/null
+++ b/packages/web/src/app/routes/platform/infra/workers/worker-groups/worker-groups-page.tsx
@@ -0,0 +1,181 @@
+import {
+ ApFlagId,
+ WorkerGroupProjectAssignment,
+ WorkerGroupSummary,
+} from '@activepieces/shared';
+import { t } from 'i18next';
+import React, { useState } from 'react';
+import { useSearchParams } from 'react-router-dom';
+
+import {
+ AdminPage,
+ AdminPageHeader,
+ adminLayout,
+ adminPageResources,
+} from '@/app/components/admin';
+import { DataFetchErrorState } from '@/components/custom/data-fetch-error-state';
+import { Button } from '@/components/ui/button';
+import {
+ Dialog,
+ DialogContent,
+ DialogDescription,
+ DialogHeader,
+ DialogTitle,
+} from '@/components/ui/dialog';
+import { flagsHooks } from '@/hooks/flags-hooks';
+import { cn } from '@/lib/utils';
+
+import { AddItemsDialog } from './add-items-dialog';
+import { GroupCards } from './group-cards';
+import { GroupPage } from './group-page';
+import {
+ PROJECT_FLOWS_PAGE_SIZE,
+ groupUtils,
+ workerGroupsQueries,
+} from './hooks';
+import { SearchBox, modelSentence } from './parts';
+import { SearchResults } from './search-results';
+import { NoGroupsGuide } from './setup-guide';
+import { FlowsTable } from './tables';
+
+export function WorkerGroupsPage() {
+ const overviewQuery = workerGroupsQueries.useOverview();
+ const overview = overviewQuery.data;
+ const { data: runLimitsEnabled } = flagsHooks.useFlag<boolean>(
+ ApFlagId.PROJECT_RATE_LIMITER_ENABLED,
+ );
+ const showRunLimit = runLimitsEnabled === true;
+ const [params, setParams] = useSearchParams();
+ const query = params.get('q') ?? '';
+ const groupParam = params.get('group');
+ const name = params.get('name') ?? '';
+ const cursor = params.get('cursor') ?? undefined;
+ const [flowsOf, setFlowsOf] = useState<WorkerGroupProjectAssignment | null>(
+ null,
+ );
+ const [addingTo, setAddingTo] = useState<WorkerGroupSummary | null>(null);
+ const searching = query.trim().length > 0;
+ const noGroups = overview !== undefined && overview.groups.length === 0;
+
+ const update = (next: Partial<Record<UrlKey, string | null>>) => {
+ setParams(
+ (prev) => {
+ const merged = new URLSearchParams(prev);
+ Object.entries(next).forEach(([key, value]) => {
+ if (value === null || value === '') merged.delete(key);
+ else merged.set(key, value);
+ });
+ return merged;
+ },
+ { replace: true },
+ );
+ };
+
+ const cards = (
+ <GroupCards
+ overview={overview}
+ onOpen={(key) => update({ group: key, name: null, cursor: null })}
+ onAdd={setAddingTo}
+ />
+ );
+
+ return (
+ <AdminPage className="max-w-6xl">
+ <AdminPageHeader
+ title={t('Worker groups')}
+ description={groupParam && !searching ? undefined : modelSentence()}
+ resources={adminPageResources.workerGroups}
+ />
+ {overviewQuery.isError && !overview ? (
+ <DataFetchErrorState
+ entity={t('worker groups')}
+ onRetry={() => overviewQuery.refetch()}
+ />
+ ) : (
+ <>
+ {(searching || !groupParam) && (
+ <SearchBox
+ value={query}
+ onChange={(value) => update({ q: value })}
+ placeholder={t('Where does a project or flow run?')}
+ />
+ )}
+ {searching ? (
+ <SearchResults overview={overview} query={query} fallback={cards} />
+ ) : groupParam && overview ? (
+ <GroupPage
+ key={groupParam}
+ overview={overview}
+ groupKey={groupParam}
+ search={name}
+ onSearchChange={(value) => update({ name: value, cursor: null })}
+ cursor={cursor}
+ onCursorChange={(next) => update({ cursor: next ?? null })}
+ onBack={() => update({ group: null, name: null, cursor: null })}
+ onOpenFlows={setFlowsOf}
+ showRunLimit={showRunLimit}
+ />
+ ) : (
+ <>
+ {cards}
+ {noGroups && <NoGroupsGuide />}
+ </>
+ )}
+ </>
+ )}
+ <Dialog
+ open={flowsOf !== null}
+ onOpenChange={(o) => !o && setFlowsOf(null)}
+ >
+ <DialogContent
+ className={cn(
+ adminLayout.dialog.lg,
+ 'flex max-h-[80vh] flex-col overflow-hidden',
+ )}
+ >
+ {flowsOf && (
+ <>
+ <DialogHeader className="mb-0 shrink-0">
+ <DialogTitle className="pr-8">
+ {t('Flows in {project}', { project: flowsOf.displayName })}
+ </DialogTitle>
+ <DialogDescription>
+ {t(
+ 'These flows run on {group}, the project’s group, unless you pick another group for a flow.',
+ {
+ group: groupUtils.name(flowsOf.workerGroupId),
+ },
+ )}
+ </DialogDescription>
+ </DialogHeader>
+ <FlowsTable
+ overview={overview}
+ projectId={flowsOf.id}
+ expectedRows={Math.min(
+ flowsOf.flowCount,
+ PROJECT_FLOWS_PAGE_SIZE,
+ )}
+ emptyText={t('This project has no flows.')}
+ scrollBody
+ footerAction={
+ <Button onClick={() => setFlowsOf(null)}>{t('Done')}</Button>
+ }
+ />
+ </>
+ )}
+ </DialogContent>
+ </Dialog>
+ {addingTo !== null && (
+ <AddItemsDialog
+ open
+ onOpenChange={(o) => !o && setAddingTo(null)}
+ overview={overview}
+ label={addingTo.label}
+ kind={addingTo.scope}
+ />
+ )}
+ </AdminPage>
+ );
+}
+
+type UrlKey = 'q' | 'group' | 'name' | 'cursor';
diff --git a/packages/web/src/features/platform-admin/api/workers-api.ts b/packages/web/src/features/platform-admin/api/workers-api.ts
index a92e245ac7e..26573913e77 100644
--- a/packages/web/src/features/platform-admin/api/workers-api.ts
+++ b/packages/web/src/features/platform-admin/api/workers-api.ts
@@ -1,7 +1,4 @@
-import {
- WorkerGroupScope,
- WorkerMachineWithStatus,
-} from '@activepieces/shared';
+import { WorkerMachineWithStatus } from '@activepieces/shared';
import { api } from '@/lib/api';
@@ -9,44 +6,4 @@ export const workersApi = {
list() {
return api.get<WorkerMachineWithStatus[]>('/v1/worker-machines');
},
- listWorkerGroups() {
- return api.get<WorkerPoolCapacity>('/v1/worker-groups');
- },
- assignProject(projectId: string, workerGroupId: string | null) {
- return api.post<void>(`/v1/worker-groups/projects/${projectId}`, {
- workerGroupId,
- });
- },
- assignFlow(flowId: string, workerGroupId: string | null) {
- return api.post<void>(`/v1/worker-groups/flows/${flowId}`, {
- workerGroupId,
- });
- },
- listGroupFlows(workerGroupId: string) {
- return api.get<WorkerGroupFlows>('/v1/worker-groups/flows', {
- workerGroupId,
- });
- },
-};
-
-export type WorkerGroupInfo = {
- label: string;
- slots: number;
- scope: WorkerGroupScope;
-};
-
-export type WorkerPoolCapacity = {
- groups: WorkerGroupInfo[];
- sharedSlots: number;
-};
-
-export type WorkerGroupFlow = {
- id: string;
- projectId: string;
- displayName: string;
-};
-
-export type WorkerGroupFlows = {
- flows: WorkerGroupFlow[];
- total: number;
};
diff --git a/packages/web/src/features/platform-admin/hooks/workers-hooks.ts b/packages/web/src/features/platform-admin/hooks/workers-hooks.ts
index 6ba9de9606f..52af933a356 100644
--- a/packages/web/src/features/platform-admin/hooks/workers-hooks.ts
+++ b/packages/web/src/features/platform-admin/hooks/workers-hooks.ts
@@ -1,11 +1,10 @@
import { WorkerMachineWithStatus } from '@activepieces/shared';
import { useQuery } from '@tanstack/react-query';
-import { workersApi, WorkerPoolCapacity } from '../api/workers-api';
+import { workersApi } from '../api/workers-api';
export const workersKeys = {
all: ['worker-machines'] as const,
- groups: ['worker-groups'] as const,
};
export const workersQueries = {
@@ -17,13 +16,4 @@ export const workersQueries = {
refetchInterval: 5000,
queryFn: () => workersApi.list(),
}),
- useWorkerGroups: (enabled: boolean) =>
- useQuery<WorkerPoolCapacity>({
- queryKey: workersKeys.groups,
- staleTime: 0,
- gcTime: 0,
- refetchInterval: 5000,
- queryFn: () => workersApi.listWorkerGroups(),
- enabled,
- }),
};
diff --git a/packages/web/src/features/projects/stores/project-collection.ts b/packages/web/src/features/projects/stores/project-collection.ts
index 4bcce1eaa52..377e7e012a2 100644
--- a/packages/web/src/features/projects/stores/project-collection.ts
+++ b/packages/web/src/features/projects/stores/project-collection.ts
@@ -71,6 +71,24 @@ export const projectCollection = createCollection<ProjectWithLimits, string>(
let authoritativeProjectsGeneration = 0;
export const projectCollectionUtils = {
+ syncFromServer: (project: ProjectWithLimits) => {
+ if (projectCollection.isReady()) {
+ projectCollection.utils.writeUpdate(project);
+ }
+ },
+ setWorkerGroup: ({
+ projectIds,
+ workerGroupId,
+ }: {
+ projectIds: string[];
+ workerGroupId: string | null;
+ }) => {
+ if (!projectCollection.isReady()) return;
+ const rows = projectIds
+ .filter((id) => projectCollection.has(id))
+ .map((id) => ({ id, workerGroupId }));
+ if (rows.length > 0) projectCollection.utils.writeUpdate(rows);
+ },
useCreateProject: (
onSuccess: (project: ProjectWithLimits) => void,
onError: (error: Error) => void,