float HeightOfTile = 2.56f;
Vector3Int indexOfCell = new Vector3Int(i, j);
Vector3 worldPosition = tilemap.GetCellCenterWorld(indexOfCell);
worldPosition.y += HeightOfTile / 2f; // GetCellCenterWorld always return the bottom-center of the tile so I have to add half of the height of tile before changing it to the GridNode in case the boundary problem
GraphNode gridNode = AstarPath.active.data.gridGraph.GetNearest(worldPosition).node;

Get the cellPosition of tilemap by gridNode

float HeightOfTile = 2.56f;
var worldPosition = (Vector3)gridNode.position;
worldPosition.y -= HeightOfTile / 2f; // have to add this line or the cellPosition is the wrong one
var cellPosition = tilemap.WorldToCell(worldPosition);

for now, my project seems working fine but not sure if the solution is correct when add/substract 1.28f to the worldPosition.y;
I have aligned the hexagonal grid to my tilemap., wonder if somewhere exists API for me to do transformation between cellPosition in tilemap and gridNode in Astar

There’s no such conversion built-in at the moment. Though I think your conversion will be more stable if you base it on the grid coordinates, which can be accessed using gridNode.XCoordinateInGrid and gridNode.ZCoordinateInGrid.

Yeah, that’s exactly what I want, I’m going to find the formula between cellPosition and gridNodePosition
but I’m not very familiar with the X(Z)CoordinateInGrid, can you give me some hits about it,
Given :

Tilemap size is 25 * 20,

A* size is 40 * 30,

(0,0) in cellPosition == (X, Y) in gridNodePosition

The formula I need:

(a, b) in cellPosition => (?, ?) in gridNodePosition

(a, b) in gridNodePosition => (?, ?) in cellPosition