// (C) 2021-2026 GoodData Corporation
export async function loadWorkspaceAutomationsCount(ctx, settings) {
    const { backend, workspace } = ctx;
    if (!(settings?.enableScheduling || settings?.enableAlerting) ||
        ctx.config?.isReadOnly ||
        ctx.config?.isExport ||
        ctx.config?.initialRenderMode === "export") {
        return Promise.resolve(0);
    }
    const result = await backend.workspace(workspace).automations().getAutomationsQuery().withSize(1).query();
    return result.totalCount ?? 0;
}
//# sourceMappingURL=loadWorkspaceAutomationsCount.js.map