Parallel timelines layout

Hello everyone.
I’m trying to draw a few timelines with events in them. Events happen one by one (black edges) but different events belong to different timelines (red edges). This is what it looks like, three parallel timelines with three events in each:


With this code:

digraph {
  node [shape=box];

  "TL 1 event 1" [group=TL1];
  "TL 1 event 2" [group=TL1];
  "TL 1 event 3" [group=TL1];

  "TL 2 event 1" [group=TL2];
  "TL 2 event 2" [group=TL2];
  "TL 2 event 3" [group=TL2];

  "TL 3 event 1" [group=TL3];
  "TL 3 event 2" [group=TL3];
  "TL 3 event 3" [group=TL3];

  "TL 1 event 1" -> "TL 1 event 2" [color=red];
  "TL 1 event 2" -> "TL 1 event 3" [color=red];

  "TL 2 event 1" -> "TL 2 event 2" [color=red];
  "TL 2 event 2" -> "TL 2 event 3" [color=red];

  "TL 3 event 1" -> "TL 3 event 2" [color=red];
  "TL 3 event 2" -> "TL 3 event 3" [color=red];


  "TL 2 event 1" -> "TL 1 event 1";
  "TL 1 event 1" -> "TL 2 event 2";
  "TL 1 event 2" -> "TL 2 event 3";

  "TL 3 event 1" -> "TL 1 event 2";
  "TL 2 event 2" -> "TL 3 event 1";

  "TL 2 event 3" -> "TL 1 event 3";

  "TL 1 event 3" -> "TL 3 event 2";
  "TL 3 event 2" -> "TL 3 event 3";
}

This is perfectly what I want but when the nodes are significantly bigger the vertical stacks of nodes often shift horizontally and red arrows become not exactly vertical. This is what it looks like on zoomed out large graph:

8< == forum ate my image, following in the next post == >8

So, my question is, is there a way to make sure the red edges are always vertical, while maintaining event order?

The missing image from the initial post:

would you please post the source for the bigger & more troublesome graph.

Sure. Here it is: Untitled - Pastebin the problem begins at node 1241.

Sure. Here it is. The problem begins at node 1241.

graph source
digraph { splines=false; fontsize=8; node [shape=box];
1118 [
                label="  1118 <<<\l  [0] Parse completion\l\l  [1] Bind completion\l\l  [2] Row description:\l  id, createdAt, updatedAt\l\l  [3] Data row:\l  1, 2021-02-13 02:14:47.389+00, \l  2021-02-13 02:14:47.389+00\l\l  [4] Command completion:\l  INSERT 0 1\l"
                group=41376

                ]
1122 [
                label="  1122 >>>\l  [0] Startup message\l"
                group=41380

                ]
1118 -> 1122
1124 [
                label="  1124 <<<\l  [0] Authentication request\l\l  [1] Parameter status:\l  Parameter status \l  application_name = ''\l\l  [2] Parameter status:\l  Parameter status \l  client_encoding = 'UTF8'\l\l  [3] Parameter status:\l  Parameter status DateStyle = \l  'ISO, MDY'\l\l  [4] Parameter status:\l  Parameter status \l  integer_datetimes = 'on'\l\l  [5] Parameter status:\l  Parameter status IntervalStyle \l  = 'postgres'\l\l  [6] Parameter status:\l  Parameter status is_superuser \l  = 'on'\l\l  [7] Parameter status:\l  Parameter status \l  server_encoding = 'UTF8'\l\l  [8] Parameter status:\l  Parameter status \l  server_version = '10.5 (Debian \l  10.5-1.pgdg90+1)'\l\l  [9] Parameter status:\l  Parameter status \l  session_authorization = \l  'postgres'\l\l  [10] Parameter status:\l  Parameter status \l  standard_conforming_strings = \l  'on'\l\l  [11] Parameter status:\l  Parameter status TimeZone = \l  'UTC'\l\l  [12] Backend key data\l\l  [13] Ready for query\l"
                group=41380

                ]
1122 -> 1124 [color=red]
1126 [
                label="  1126 >>>\l  [0] Simple query:\l  SET client_min_messages TO \l  warning;SET TIME ZONE INTERVAL \l  '+00:00' HOUR TO MINUTE;\l"
                group=41380

                ]
1124 -> 1126 [color=red]
1128 [
                label="  1128 <<<\l  [0] Command completion:\l  SET\l\l  [1] Parameter status:\l  Parameter status TimeZone = \l  '<+00>-00'\l\l  [2] Command completion:\l  SET\l\l  [3] Ready for query\l"
                group=41380

                ]
1126 -> 1128 [color=red]
1130 [
                label="  1130 >>>\l  [0] Parse:\l  INSERT INTO \"archive\".\"Users\" \l  (\"id\",\"createdAt\",\"updatedAt\") \l  VALUES ($1,$2,$3) RETURNING \l  \"id\",\"createdAt\",\"updatedAt\";\l"
                group=41380

                ]
1128 -> 1130 [color=red]
1132 [
                label="  1132 >>>\l  [0] Bind:\l  [\"2\",\"2021-02-13 02:14:47.391 \l  +00:00\",\"2021-02-13 \l  02:14:47.391 +00:00\"]\l"
                group=41380

                ]
1130 -> 1132 [color=red]
1134 [
                label="  1134 >>>\l  [0] Describe\l"
                group=41380

                ]
1132 -> 1134 [color=red]
1136 [
                label="  1136 >>>\l  [0] Execute\l"
                group=41380

                ]
1134 -> 1136 [color=red]
1138 [
                label="  1138 >>>\l  [0] Flush\l"
                group=41380

                ]
1136 -> 1138 [color=red]
1140 [
                label="  1140 >>>\l  [0] Sync\l"
                group=41380

                ]
1138 -> 1140 [color=red]
1142 [
                label="  1142 <<<\l  [0] Ready for query\l"
                group=41376

                ]
1118 -> 1142 [color=red]
1140 -> 1142
1144 [
                label="  1144 <<<\l  [0] Parse completion\l\l  [1] Bind completion\l\l  [2] Row description:\l  id, createdAt, updatedAt\l\l  [3] Data row:\l  2, 2021-02-13 02:14:47.391+00, \l  2021-02-13 02:14:47.391+00\l\l  [4] Command completion:\l  INSERT 0 1\l"
                group=41380

                ]
1140 -> 1144 [color=red]
1142 -> 1144
1146 [
                label="  1146 <<<\l  [0] Ready for query\l"
                group=41380

                ]
1144 -> 1146 [color=red]
1148 [
                label="  1148 >>>\l  [0] Parse:\l  INSERT INTO \"archive\".\"Tasks\" \l  (\"id\",\"title\",\"createdAt\",\"updatedAt\",\"UserId\") \l  VALUES ($1,$2,$3,$4,$5) \l  RETURNING \l  \"id\",\"title\",\"createdAt\",\"updatedAt\",\"UserId\";\l"
                group=41376

                ]
1142 -> 1148 [color=red]
1146 -> 1148
1149 [
                label="  1149 >>>\l  [0] Bind:\l  [\"1\",\"b\",\"2021-02-13 \l  02:14:47.409 \l  +00:00\",\"2021-02-13 \l  02:14:47.409 +00:00\",\"1\"]\l"
                group=41376

                ]
1148 -> 1149 [color=red]
1150 [
                label="  1150 >>>\l  [0] Describe\l"
                group=41376

                ]
1149 -> 1150 [color=red]
1151 [
                label="  1151 >>>\l  [0] Execute\l"
                group=41376

                ]
1150 -> 1151 [color=red]
1152 [
                label="  1152 >>>\l  [0] Flush\l"
                group=41376

                ]
1151 -> 1152 [color=red]
1153 [
                label="  1153 >>>\l  [0] Sync\l"
                group=41376

                ]
1152 -> 1153 [color=red]
1164 [
                label="  1164 <<<\l  [0] Parse completion\l\l  [1] Bind completion\l\l  [2] Row description:\l  id, title, createdAt, \l  updatedAt, UserId\l\l  [3] Data row:\l  1, b, 2021-02-13 \l  02:14:47.409+00, 2021-02-13 \l  02:14:47.409+00, 1\l\l  [4] Command completion:\l  INSERT 0 1\l"
                group=41376

                ]
1153 -> 1164 [color=red]
1165 [
                label="  1165 >>>\l  [0] Parse:\l  INSERT INTO \"archive\".\"Tasks\" \l  (\"id\",\"title\",\"createdAt\",\"updatedAt\",\"UserId\") \l  VALUES ($1,$2,$3,$4,$5) \l  RETURNING \l  \"id\",\"title\",\"createdAt\",\"updatedAt\",\"UserId\";\l"
                group=41380

                ]
1146 -> 1165 [color=red]
1164 -> 1165
1167 [
                label="  1167 >>>\l  [0] Bind:\l  [\"2\",\"d\",\"2021-02-13 \l  02:14:47.410 \l  +00:00\",\"2021-02-13 \l  02:14:47.410 +00:00\",\"1\"]\l"
                group=41380

                ]
1165 -> 1167 [color=red]
1169 [
                label="  1169 >>>\l  [0] Describe\l"
                group=41380

                ]
1167 -> 1169 [color=red]
1171 [
                label="  1171 >>>\l  [0] Execute\l"
                group=41380

                ]
1169 -> 1171 [color=red]
1173 [
                label="  1173 >>>\l  [0] Flush\l"
                group=41380

                ]
1171 -> 1173 [color=red]
1174 [
                label="  1174 >>>\l  [0] Sync\l"
                group=41380

                ]
1173 -> 1174 [color=red]
1176 [
                label="  1176 <<<\l  [0] Parse completion\l\l  [1] Bind completion\l\l  [2] Row description:\l  id, title, createdAt, \l  updatedAt, UserId\l\l  [3] Data row:\l  2, d, 2021-02-13 \l  02:14:47.41+00, 2021-02-13 \l  02:14:47.41+00, 1\l\l  [4] Command completion:\l  INSERT 0 1\l"
                group=41380

                ]
1174 -> 1176 [color=red]
1178 [
                label="  1178 <<<\l  [0] Ready for query\l"
                group=41376

                ]
1164 -> 1178 [color=red]
1176 -> 1178
1180 [
                label="  1180 >>>\l  [0] Startup message\l"
                group=41386

                ]
1178 -> 1180
1182 [
                label="  1182 >>>\l  [0] Startup message\l"
                group=41388

                ]
1180 -> 1182
1184 [
                label="  1184 >>>\l  [0] Startup message\l"
                group=41392

                ]
1182 -> 1184
1186 [
                label="  1186 >>>\l  [0] Parse:\l  INSERT INTO \"archive\".\"Tasks\" \l  (\"id\",\"title\",\"createdAt\",\"updatedAt\",\"UserId\") \l  VALUES ($1,$2,$3,$4,$5) \l  RETURNING \l  \"id\",\"title\",\"createdAt\",\"updatedAt\",\"UserId\";\l"
                group=41376

                ]
1178 -> 1186 [color=red]
1184 -> 1186
1187 [
                label="  1187 <<<\l  [0] Authentication request\l\l  [1] Parameter status:\l  Parameter status \l  application_name = ''\l\l  [2] Parameter status:\l  Parameter status \l  client_encoding = 'UTF8'\l\l  [3] Parameter status:\l  Parameter status DateStyle = \l  'ISO, MDY'\l\l  [4] Parameter status:\l  Parameter status \l  integer_datetimes = 'on'\l\l  [5] Parameter status:\l  Parameter status IntervalStyle \l  = 'postgres'\l\l  [6] Parameter status:\l  Parameter status is_superuser \l  = 'on'\l\l  [7] Parameter status:\l  Parameter status \l  server_encoding = 'UTF8'\l\l  [8] Parameter status:\l  Parameter status \l  server_version = '10.5 (Debian \l  10.5-1.pgdg90+1)'\l\l  [9] Parameter status:\l  Parameter status \l  session_authorization = \l  'postgres'\l\l  [10] Parameter status:\l  Parameter status \l  standard_conforming_strings = \l  'on'\l\l  [11] Parameter status:\l  Parameter status TimeZone = \l  'UTC'\l\l  [12] Backend key data\l\l  [13] Ready for query\l"
                group=41388

                ]
1182 -> 1187 [color=red]
1186 -> 1187
1189 [
                label="  1189 >>>\l  [0] Bind:\l  [\"3\",\"c\",\"2021-02-13 \l  02:14:47.410 \l  +00:00\",\"2021-02-13 \l  02:14:47.410 +00:00\",\"1\"]\l"
                group=41376

                ]
1186 -> 1189 [color=red]
1187 -> 1189
1190 [
                label="  1190 >>>\l  [0] Describe\l"
                group=41376

                ]
1189 -> 1190 [color=red]
1192 [
                label="  1192 <<<\l  [0] Authentication request\l\l  [1] Parameter status:\l  Parameter status \l  application_name = ''\l\l  [2] Parameter status:\l  Parameter status \l  client_encoding = 'UTF8'\l\l  [3] Parameter status:\l  Parameter status DateStyle = \l  'ISO, MDY'\l\l  [4] Parameter status:\l  Parameter status \l  integer_datetimes = 'on'\l\l  [5] Parameter status:\l  Parameter status IntervalStyle \l  = 'postgres'\l\l  [6] Parameter status:\l  Parameter status is_superuser \l  = 'on'\l\l  [7] Parameter status:\l  Parameter status \l  server_encoding = 'UTF8'\l\l  [8] Parameter status:\l  Parameter status \l  server_version = '10.5 (Debian \l  10.5-1.pgdg90+1)'\l\l  [9] Parameter status:\l  Parameter status \l  session_authorization = \l  'postgres'\l\l  [10] Parameter status:\l  Parameter status \l  standard_conforming_strings = \l  'on'\l\l  [11] Parameter status:\l  Parameter status TimeZone = \l  'UTC'\l\l  [12] Backend key data\l\l  [13] Ready for query\l"
                group=41386

                ]
1180 -> 1192 [color=red]
1190 -> 1192
1194 [
                label="  1194 <<<\l  [0] Authentication request\l\l  [1] Parameter status:\l  Parameter status \l  application_name = ''\l\l  [2] Parameter status:\l  Parameter status \l  client_encoding = 'UTF8'\l\l  [3] Parameter status:\l  Parameter status DateStyle = \l  'ISO, MDY'\l\l  [4] Parameter status:\l  Parameter status \l  integer_datetimes = 'on'\l\l  [5] Parameter status:\l  Parameter status IntervalStyle \l  = 'postgres'\l\l  [6] Parameter status:\l  Parameter status is_superuser \l  = 'on'\l\l  [7] Parameter status:\l  Parameter status \l  server_encoding = 'UTF8'\l\l  [8] Parameter status:\l  Parameter status \l  server_version = '10.5 (Debian \l  10.5-1.pgdg90+1)'\l\l  [9] Parameter status:\l  Parameter status \l  session_authorization = \l  'postgres'\l\l  [10] Parameter status:\l  Parameter status \l  standard_conforming_strings = \l  'on'\l\l  [11] Parameter status:\l  Parameter status TimeZone = \l  'UTC'\l\l  [12] Backend key data\l\l  [13] Ready for query\l"
                group=41392

                ]
1184 -> 1194 [color=red]
1192 -> 1194
1196 [
                label="  1196 >>>\l  [0] Execute\l\l  [1] Flush\l"
                group=41376

                ]
1190 -> 1196 [color=red]
1194 -> 1196
1197 [
                label="  1197 >>>\l  [0] Sync\l"
                group=41376

                ]
1196 -> 1197 [color=red]
1198 [
                label="  1198 <<<\l  [0] Parse completion\l\l  [1] Bind completion\l\l  [2] Row description:\l  id, title, createdAt, \l  updatedAt, UserId\l\l  [3] Data row:\l  3, c, 2021-02-13 \l  02:14:47.41+00, 2021-02-13 \l  02:14:47.41+00, 1\l\l  [4] Command completion:\l  INSERT 0 1\l"
                group=41376

                ]
1197 -> 1198 [color=red]
1199 [
                label="  1199 >>>\l  [0] Simple query:\l  SET client_min_messages TO \l  warning;SET TIME ZONE INTERVAL \l  '+00:00' HOUR TO MINUTE;\l"
                group=41388

                ]
1187 -> 1199 [color=red]
1198 -> 1199
1201 [
                label="  1201 >>>\l  [0] Simple query:\l  SET client_min_messages TO \l  warning;SET TIME ZONE INTERVAL \l  '+00:00' HOUR TO MINUTE;\l"
                group=41386

                ]
1192 -> 1201 [color=red]
1199 -> 1201
1203 [
                label="  1203 <<<\l  [0] Command completion:\l  SET\l\l  [1] Parameter status:\l  Parameter status TimeZone = \l  '<+00>-00'\l\l  [2] Command completion:\l  SET\l\l  [3] Ready for query\l"
                group=41388

                ]
1199 -> 1203 [color=red]
1201 -> 1203
1205 [
                label="  1205 >>>\l  [0] Simple query:\l  SET client_min_messages TO \l  warning;SET TIME ZONE INTERVAL \l  '+00:00' HOUR TO MINUTE;\l"
                group=41392

                ]
1194 -> 1205 [color=red]
1203 -> 1205
1207 [
                label="  1207 <<<\l  [0] Command completion:\l  SET\l\l  [1] Parameter status:\l  Parameter status TimeZone = \l  '<+00>-00'\l\l  [2] Command completion:\l  SET\l\l  [3] Ready for query\l"
                group=41386

                ]
1201 -> 1207 [color=red]
1205 -> 1207
1209 [
                label="  1209 <<<\l  [0] Command completion:\l  SET\l\l  [1] Parameter status:\l  Parameter status TimeZone = \l  '<+00>-00'\l\l  [2] Command completion:\l  SET\l\l  [3] Ready for query\l"
                group=41392

                ]
1205 -> 1209 [color=red]
1207 -> 1209
1211 [
                label="  1211 >>>\l  [0] Parse:\l  INSERT INTO \"archive\".\"Tasks\" \l  (\"id\",\"title\",\"createdAt\",\"updatedAt\",\"UserId\") \l  VALUES ($1,$2,$3,$4,$5) \l  RETURNING \l  \"id\",\"title\",\"createdAt\",\"updatedAt\",\"UserId\";\l"
                group=41388

                ]
1203 -> 1211 [color=red]
1209 -> 1211
1213 [
                label="  1213 >>>\l  [0] Bind:\l  [\"4\",\"a\",\"2021-02-13 \l  02:14:47.410 \l  +00:00\",\"2021-02-13 \l  02:14:47.410 +00:00\",\"1\"]\l"
                group=41388

                ]
1211 -> 1213 [color=red]
1215 [
                label="  1215 >>>\l  [0] Describe\l"
                group=41388

                ]
1213 -> 1215 [color=red]
1217 [
                label="  1217 >>>\l  [0] Execute\l"
                group=41388

                ]
1215 -> 1217 [color=red]
1219 [
                label="  1219 >>>\l  [0] Flush\l"
                group=41388

                ]
1217 -> 1219 [color=red]
1221 [
                label="  1221 >>>\l  [0] Sync\l"
                group=41388

                ]
1219 -> 1221 [color=red]
1223 [
                label="  1223 <<<\l  [0] Ready for query\l"
                group=41380

                ]
1176 -> 1223 [color=red]
1221 -> 1223
1225 [
                label="  1225 >>>\l  [0] Parse:\l  INSERT INTO \"archive\".\"Tasks\" \l  (\"id\",\"title\",\"createdAt\",\"updatedAt\",\"UserId\") \l  VALUES ($1,$2,$3,$4,$5) \l  RETURNING \l  \"id\",\"title\",\"createdAt\",\"updatedAt\",\"UserId\";\l"
                group=41386

                ]
1207 -> 1225 [color=red]
1223 -> 1225
1227 [
                label="  1227 >>>\l  [0] Bind:\l  [\"5\",\"a\",\"2021-02-13 \l  02:14:47.416 \l  +00:00\",\"2021-02-13 \l  02:14:47.416 +00:00\",\"2\"]\l"
                group=41386

                ]
1225 -> 1227 [color=red]
1229 [
                label="  1229 >>>\l  [0] Describe\l"
                group=41386

                ]
1227 -> 1229 [color=red]
1231 [
                label="  1231 >>>\l  [0] Execute\l"
                group=41386

                ]
1229 -> 1231 [color=red]
1233 [
                label="  1233 >>>\l  [0] Flush\l"
                group=41386

                ]
1231 -> 1233 [color=red]
1235 [
                label="  1235 >>>\l  [0] Sync\l"
                group=41386

                ]
1233 -> 1235 [color=red]
1237 [
                label="  1237 <<<\l  [0] Parse completion\l\l  [1] Bind completion\l\l  [2] Row description:\l  id, title, createdAt, \l  updatedAt, UserId\l\l  [3] Data row:\l  4, a, 2021-02-13 \l  02:14:47.41+00, 2021-02-13 \l  02:14:47.41+00, 1\l\l  [4] Command completion:\l  INSERT 0 1\l"
                group=41388

                ]
1221 -> 1237 [color=red]
1235 -> 1237
1239 [
                label="  1239 >>>\l  [0] Parse:\l  INSERT INTO \"archive\".\"Tasks\" \l  (\"id\",\"title\",\"createdAt\",\"updatedAt\",\"UserId\") \l  VALUES ($1,$2,$3,$4,$5) \l  RETURNING \l  \"id\",\"title\",\"createdAt\",\"updatedAt\",\"UserId\";\l"
                group=41392

                ]
1209 -> 1239 [color=red]
1237 -> 1239
1241 [
                label="  1241 >>>\l  [0] Bind:\l  [\"6\",\"c\",\"2021-02-13 \l  02:14:47.417 \l  +00:00\",\"2021-02-13 \l  02:14:47.417 +00:00\",\"2\"]\l\l  [1] Describe\l"
                group=41392

                ]
1239 -> 1241 [color=red]
1243 [
                label="  1243 >>>\l  [0] Execute\l"
                group=41392

                ]
1241 -> 1243 [color=red]
1245 [
                label="  1245 >>>\l  [0] Flush\l"
                group=41392

                ]
1243 -> 1245 [color=red]
1247 [
                label="  1247 >>>\l  [0] Sync\l"
                group=41392

                ]
1245 -> 1247 [color=red]
1249 [
                label="  1249 <<<\l  [0] Parse completion\l\l  [1] Bind completion\l\l  [2] Row description:\l  id, title, createdAt, \l  updatedAt, UserId\l\l  [3] Data row:\l  5, a, 2021-02-13 \l  02:14:47.416+00, 2021-02-13 \l  02:14:47.416+00, 2\l\l  [4] Command completion:\l  INSERT 0 1\l"
                group=41386

                ]
1235 -> 1249 [color=red]
1247 -> 1249
1251 [
                label="  1251 >>>\l  [0] Parse:\l  INSERT INTO \"archive\".\"Tasks\" \l  (\"id\",\"title\",\"createdAt\",\"updatedAt\",\"UserId\") \l  VALUES ($1,$2,$3,$4,$5) \l  RETURNING \l  \"id\",\"title\",\"createdAt\",\"updatedAt\",\"UserId\";\l"
                group=41380

                ]
1223 -> 1251 [color=red]
1249 -> 1251
1253 [
                label="  1253 >>>\l  [0] Bind:\l  [\"7\",\"b\",\"2021-02-13 \l  02:14:47.417 \l  +00:00\",\"2021-02-13 \l  02:14:47.417 +00:00\",\"2\"]\l"
                group=41380

                ]
1251 -> 1253 [color=red]
1254 [
                label="  1254 >>>\l  [0] Describe\l"
                group=41380

                ]
1253 -> 1254 [color=red]
1256 [
                label="  1256 >>>\l  [0] Execute\l"
                group=41380

                ]
1254 -> 1256 [color=red]
1257 [
                label="  1257 >>>\l  [0] Flush\l"
                group=41380

                ]
1256 -> 1257 [color=red]
1258 [
                label="  1258 >>>\l  [0] Sync\l"
                group=41380

                ]
1257 -> 1258 [color=red]
1260 [
                label="  1260 <<<\l  [0] Parse completion\l\l  [1] Bind completion\l\l  [2] Row description:\l  id, title, createdAt, \l  updatedAt, UserId\l\l  [3] Data row:\l  7, b, 2021-02-13 \l  02:14:47.417+00, 2021-02-13 \l  02:14:47.417+00, 2\l\l  [4] Command completion:\l  INSERT 0 1\l"
                group=41380

                ]
1258 -> 1260 [color=red]
1261 [
                label="  1261 <<<\l  [0] Parse completion\l\l  [1] Bind completion\l\l  [2] Row description:\l  id, title, createdAt, \l  updatedAt, UserId\l\l  [3] Data row:\l  6, c, 2021-02-13 \l  02:14:47.417+00, 2021-02-13 \l  02:14:47.417+00, 2\l\l  [4] Command completion:\l  INSERT 0 1\l"
                group=41392

                ]
1247 -> 1261 [color=red]
1260 -> 1261
1263 [
                label="  1263 <<<\l  [0] Ready for query\l"
                group=41376

                ]
1198 -> 1263 [color=red]
1261 -> 1263
1265 [
                label="  1265 <<<\l  [0] Ready for query\l"
                group=41386

                ]
1249 -> 1265 [color=red]
1263 -> 1265
1266 [
                label="  1266 <<<\l  [0] Ready for query\l"
                group=41392

                ]
1261 -> 1266 [color=red]
1265 -> 1266
1267 [
                label="  1267 <<<\l  [0] Ready for query\l"
                group=41380

                ]
1260 -> 1267 [color=red]
1266 -> 1267
1270 [
                label="  1270 <<<\l  [0] Ready for query\l"
                group=41388

                ]
1237 -> 1270 [color=red]
1267 -> 1270
1273 [
                label="  1273 >>>\l  [0] Simple query:\l  SELECT \"User\".\"id\", \l  \"User\".\"createdAt\", \l  \"User\".\"updatedAt\", \l  \"tasks\".\"id\" AS \"tasks.id\", \l  \"tasks\".\"title\" AS \l  \"tasks.title\", \l  \"tasks\".\"createdAt\" AS \l  \"tasks.createdAt\", \l  \"tasks\".\"updatedAt\" AS \l  \"tasks.updatedAt\", \l  \"tasks\".\"UserId\" AS \l  \"tasks.UserId\" FROM \l  \"archive\".\"Users\" AS \"User\" \l  LEFT OUTER JOIN LATERAL \l  (SELECT * FROM \l  \"archive\".\"Tasks\" AS \"tasks\" \l  WHERE \"User\".\"id\" = \l  \"tasks\".\"UserId\" LIMIT 2) as \l  \"tasks\" ON true ORDER BY \l  \"User\".\"id\" ASC;\l"
                group=41380

                ]
1267 -> 1273 [color=red]
1270 -> 1273
1275 [
                label="  1275 <<<\l  [0] Row description:\l  id, createdAt, updatedAt, \l  tasks.id, tasks.title, \l  tasks.createdAt, \l  tasks.updatedAt, tasks.UserId\l\l  [1] Data row:\l  1, 2021-02-13 02:14:47.389+00, \l  2021-02-13 02:14:47.389+00, 1, \l  b, 2021-02-13 02:14:47.409+00, \l  2021-02-13 02:14:47.409+00, 1\l\l  [2] Data row:\l  1, 2021-02-13 02:14:47.389+00, \l  2021-02-13 02:14:47.389+00, 2, \l  d, 2021-02-13 02:14:47.41+00, \l  2021-02-13 02:14:47.41+00, 1\l\l  [3] Data row:\l  2, 2021-02-13 02:14:47.391+00, \l  2021-02-13 02:14:47.391+00, 5, \l  a, 2021-02-13 02:14:47.416+00, \l  2021-02-13 02:14:47.416+00, 2\l\l  [4] Data row:\l  2, 2021-02-13 02:14:47.391+00, \l  2021-02-13 02:14:47.391+00, 7, \l  b, 2021-02-13 02:14:47.417+00, \l  2021-02-13 02:14:47.417+00, 2\l\l  [5] Command completion:\l  SELECT 4\l\l  [6] Ready for query\l"
                group=41380

                ]
1273 -> 1275 [color=red]
1276 [
                label="  1276 >>>\l  [0] Simple query:\l  SELECT table_name FROM \l  information_schema.tables \l  WHERE table_schema = 'public' \l  AND table_type LIKE '%TABLE' \l  AND table_name != \l  'spatial_ref_sys';\l"
                group=41380

                ]
1275 -> 1276 [color=red]
1278 [
                label="  1278 <<<\l  [0] Row description:\l  table_name\l\l  [1] Command completion:\l  SELECT 0\l\l  [2] Ready for query\l"
                group=41380

                ]
1276 -> 1278 [color=red]
1279 [
                label="  1279 >>>\l  [0] Simple query:\l  SELECT t.typname enum_name, \l  array_agg(e.enumlabel ORDER BY \l  enumsortorder) enum_value FROM \l  pg_type t JOIN pg_enum e ON \l  t.oid = e.enumtypid JOIN \l  pg_catalog.pg_namespace n ON \l  n.oid = t.typnamespace WHERE \l  n.nspname = 'public' GROUP BY \l  1\l"
                group=41380

                ]
1278 -> 1279 [color=red]
1280 [
                label="  1280 <<<\l  [0] Row description:\l  enum_name, enum_value\l\l  [1] Command completion:\l  SELECT 0\l\l  [2] Ready for query\l"
                group=41380

                ]
1279 -> 1280 [color=red]
1281 [
                label="  1281 >>>\l  [0] Simple query:\l  SELECT schema_name FROM \l  information_schema.schemata \l  WHERE schema_name <> \l  'information_schema' AND \l  schema_name != 'public' AND \l  schema_name !~ E'^pg_';\l"
                group=41380

                ]
1280 -> 1281 [color=red]
1282 [
                label="  1282 <<<\l  [0] Row description:\l  schema_name\l\l  [1] Data row:\l  archive\l\l  [2] Command completion:\l  SELECT 1\l\l  [3] Ready for query\l"
                group=41380

                ]
1281 -> 1282 [color=red]
1283 [
                label="  1283 >>>\l  [0] Simple query:\l  DROP SCHEMA IF EXISTS archive \l  CASCADE;\l"
                group=41380

                ]
1282 -> 1283 [color=red]
1284 [
                label="  1284 <<<\l  [0] Command completion:\l  DROP SCHEMA\l\l  [1] Ready for query\l"
                group=41380

                ]
1283 -> 1284 [color=red]
}

Turning your groups into cluster subgraphs seems to solve the problem (though I’m not sure it is guaranteed)’ (See here for more info on clusters: https://www.graphviz.org/pdf/dotguide.pdf).
This GVPR program transformed your source:

BEGIN{
  string clusterName;
  graph_t aCluster;
}
BEG_G{
  $G.newrank="true";
//  $G.remincross="true";  
}
N{
  clusterName=sprintf("cluster_%s", $.group);
  print("//  cluster: ", clusterName);
  aCluster=subg($G, clusterName);
  aCluster.peripheries=0;
  aCluster.margin=20;  
  
  subnode(aCluster, $);
}

With this command line (Linux):
gvpr -c -f group2cluster.gvpr yourfile.gv |dot -Tdot >yourfile.dot

It worked, thank you! It turns out Graphviz provides much more magic spells than I thought. But this situation leaves me with even more questions. Why groups didn’t work in the first place? Output of your GVPR program contains absolute coordinates for each node. Is there a “fair” way to do it without absolute positioning? I’m sorry if my questions are answered in the doc you provided, I had no chance to dig into it yet.

Your goal was to make a set of nodes (and edges) strictly vertical. A common goal.
But to my knowledge, the only way to guarantee node alignment to be vertical (or more commonly horizontal) is to include the nodes in a subgroup that has the rank=same attribute, like so:
{ rank=same a b c d e }
(fyi, I tried this on your smaller graph with rankdir=LR, but the resulting graph was not “right” - the sequence of nodes was confusing). You really seem to want, {file=same a b c d e} - but Graphviz does not support this concept. (file - as in rank and file - is equivalent to column=same)

Anyway, I don’t think group guarantees anything other than an effort to prevent multi-line or splined edges. i.e. I believe that diagonal lines (edges) are OK. Not what you want.
Here is more info on the group attribute: A question about the GROUP attribute: what does STRAIGHT mean? - #2 by erg

To be complete, using clusters does not guarantee vertical/horizontal alignment. But it works in this case.

Others have also asked for vertical (file) alignment capability. Unfortunately, dot does not provide it.

Dot ignores positions (pos attribute) as input. You can edit them (to anything legal) and they will have no impact. (Neato -n and gvpr are the only programs that use position values).
Here is a command line that is more direct:
gvpr -c -f group2cluster.gvpr yourfile.gv |dot -Tsvg >yourfile.svg << or any output format, like png