This is an automated email from the ASF dual-hosted git repository.

kaxilnaik pushed a commit to branch v3-0-test
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/v3-0-test by this push:
     new 17d7b604cd3 Switch to the triggered dagrun on manual trigger. (#54336)
17d7b604cd3 is described below

commit 17d7b604cd3a08489a48ccc6821a04450e7920c2
Author: Karthikeyan Singaravelan <[email protected]>
AuthorDate: Tue Aug 12 20:55:37 2025 +0530

    Switch to the triggered dagrun on manual trigger. (#54336)
    
    (cherry picked from commit 5c8c13523c7fe1fc4a6a3949a18d420eaf918138)
---
 airflow-core/src/airflow/ui/src/queries/useTrigger.ts | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/airflow-core/src/airflow/ui/src/queries/useTrigger.ts 
b/airflow-core/src/airflow/ui/src/queries/useTrigger.ts
index e033fe31a1d..fe2b1de7f93 100644
--- a/airflow-core/src/airflow/ui/src/queries/useTrigger.ts
+++ b/airflow-core/src/airflow/ui/src/queries/useTrigger.ts
@@ -18,6 +18,7 @@
  */
 import { useQueryClient } from "@tanstack/react-query";
 import { useState } from "react";
+import { useNavigate } from "react-router-dom";
 
 import {
   UseDagRunServiceGetDagRunsKeyFn,
@@ -28,14 +29,16 @@ import {
   UseTaskInstanceServiceGetTaskInstancesKeyFn,
   UseGridServiceGetGridRunsKeyFn,
 } from "openapi/queries";
+import type { TriggerDagRunResponse } from "openapi/requests/types.gen";
 import type { DagRunTriggerParams } from 
"src/components/TriggerDag/TriggerDAGForm";
 import { toaster } from "src/components/ui";
 
 export const useTrigger = ({ dagId, onSuccessConfirm }: { dagId: string; 
onSuccessConfirm: () => void }) => {
   const queryClient = useQueryClient();
   const [error, setError] = useState<unknown>(undefined);
+  const navigate = useNavigate();
 
-  const onSuccess = async () => {
+  const onSuccess = async (dagRun: TriggerDagRunResponse) => {
     const queryKeys = [
       [useDagServiceGetDagsKey],
       [useDagServiceRecentDagRunsKey],
@@ -53,6 +56,8 @@ export const useTrigger = ({ dagId, onSuccessConfirm }: { 
dagId: string; onSucce
       type: "success",
     });
     onSuccessConfirm();
+
+    navigate(`/dags/${dagRun.dag_id}/runs/${dagRun.dag_run_id}`);
   };
 
   const onError = (_error: unknown) => {

Reply via email to