Try this code:
System.log("workflow.runningUserName: " + workflow.runningUserName);
System.log("host.user: " + host.user);
deploymentId = inputProperties.deploymentId;
var restClient = host.createRestClient();
var request = restClient.createRequest("GET",'/deployment/api/deployments/'+deploymentId+'/resources', null);
var response = restClient.execute(request);
System.log(response.contentAsString);
If you use the Default vRA:Host, you'll get the following output when running via EBS:
2022-02-28 11:09:05.051 +01:00 INFO __item_stack:/item1
2022-02-28 11:09:05.056 +01:00 INFO workflow.runningUserName: vro-gateway-PI9Tb4JdsJ3u8iIR
2022-02-28 11:09:05.057 +01:00 INFO host.user: null
2022-02-28 11:09:05.076 +01:00 INFO {"message":"No value present","statusCode":404,"errorCode":0}
2022-02-28 11:09:05.082 +01:00 INFO __item_stack:/item0
What you can see here is that your WF is running with a technical user vro-gateway. When you use the Default vRA:Host, it will connect to vRA with that user and it has no permissions to get deployment data.
What you can do is to create another vRA:Host endpoint with a user (can be a technical user) that has permissions to the API, and use that endpoint in your workflow. Then you'll get this output:
2022-02-28 12:45:35.089 +01:00 INFO __item_stack:/item1
2022-02-28 12:45:35.095 +01:00 INFO workflow.runningUserName: vro-gateway-PI9Tb4JdsJ3u8iIR
2022-02-28 12:45:35.097 +01:00 INFO host.user: apiuser
2022-02-28 12:45:35.119 +01:00 INFO {"content":[{"id":"7202ac34-627f-48d2-8371-a8dea032602c" ...
2022-02-28 12:45:35.126 +01:00 INFO __item_stack:/item0