{ "kind": "open-flow-workflow", "version": 1, "name": "Create, Update and Read a Workspace User", "content": { "modelVersion": 14, "document": { "bindings": {}, "graph": { "nodes": { "n_fb2aebdaad3b8896": { "name": "Start", "kind": "start", "inputDefs": [] }, "n_0d3c525feae8ef69": { "inputs": { "url": { "kind": "value", "value": "https://admin.googleapis.com/admin/directory/v1/users" }, "body": { "kind": "value", "value": "{\"primaryEmail\":\"person@example.invalid\",\"name\":{\"givenName\":\"First\",\"familyName\":\"Last\"},\"password\":\"REPLACE_WITH_PASSWORD\"}" }, "header.Content-Type": { "kind": "value", "value": "application/json" }, "auth.token": { "kind": "unset" } }, "name": "Create the user", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "url" }, { "jsonSchema": { "type": "string" }, "nullable": true, "handle": "header.Content-Type" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "body" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "auth.token" } ], "outputs": [ { "jsonSchema": {}, "nullable": true, "handle": "body" }, { "jsonSchema": { "type": "integer" }, "nullable": false, "handle": "statusCode" }, { "jsonSchema": { "type": "object", "additionalProperties": { "type": "string" } }, "nullable": false, "handle": "headers" } ], "name": "Create the user", "executor": { "method": "POST", "query": { "mode": "fields", "names": [] }, "headers": { "mode": "fields", "names": [ "Content-Type" ] }, "bodyFormat": "text", "authentication": { "type": "bearer" }, "responseFormat": "json", "statusPolicy": "success", "kind": "http-request" } } }, "n_07eaac81ae6cd53e": { "inputs": { "body": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_0d3c525feae8ef69", "output": "body" } ] } }, "name": "Read created user ID", "kind": "task", "task": { "inputs": [ { "jsonSchema": {}, "nullable": true, "handle": "body" } ], "outputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "id" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "url" } ], "name": "Read created user ID", "moduleId": "n_1adfa6d075c80bd0", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_5698adfe5a20bdf9": { "inputs": { "url": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_07eaac81ae6cd53e", "output": "url" } ] }, "body": { "kind": "value", "value": { "name": { "familyName": "Nate" } } }, "auth.token": { "kind": "unset" } }, "name": "Update the surname", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "url" }, { "jsonSchema": {}, "nullable": true, "handle": "body" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "auth.token" } ], "outputs": [ { "jsonSchema": {}, "nullable": true, "handle": "body" }, { "jsonSchema": { "type": "integer" }, "nullable": false, "handle": "statusCode" }, { "jsonSchema": { "type": "object", "additionalProperties": { "type": "string" } }, "nullable": false, "handle": "headers" } ], "name": "Update the surname", "executor": { "method": "PUT", "query": { "mode": "fields", "names": [] }, "headers": { "mode": "fields", "names": [] }, "bodyFormat": "json", "authentication": { "type": "bearer" }, "responseFormat": "json", "statusPolicy": "success", "kind": "http-request" } } }, "n_5af6b5dd756af2da": { "inputs": { "url": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_07eaac81ae6cd53e", "output": "url" } ] }, "auth.token": { "kind": "unset" } }, "name": "Read the user", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "url" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "auth.token" } ], "outputs": [ { "jsonSchema": {}, "nullable": true, "handle": "body" }, { "jsonSchema": { "type": "integer" }, "nullable": false, "handle": "statusCode" }, { "jsonSchema": { "type": "object", "additionalProperties": { "type": "string" } }, "nullable": false, "handle": "headers" } ], "name": "Read the user", "executor": { "method": "GET", "query": { "mode": "fields", "names": [] }, "headers": { "mode": "fields", "names": [] }, "bodyFormat": "none", "authentication": { "type": "bearer" }, "responseFormat": "json", "statusPolicy": "success", "kind": "http-request" } } }, "n_bc0e53688a3c90c2": { "inputs": { "body": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_5af6b5dd756af2da", "output": "body" } ] }, "id": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_07eaac81ae6cd53e", "output": "id" } ] } }, "name": "Confirm user identity", "kind": "task", "task": { "inputs": [ { "jsonSchema": {}, "nullable": true, "handle": "body" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "id" } ], "outputs": [ { "jsonSchema": { "type": "object", "additionalProperties": true }, "nullable": false, "handle": "user" } ], "name": "Confirm user identity", "moduleId": "n_c6371e50d99d7f97", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_73493948beb05c71": { "name": "Return the user", "kind": "outputs", "outputDefs": [ { "jsonSchema": { "type": "object", "additionalProperties": true }, "nullable": false, "handle": "user" } ], "outputMappings": { "user": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_bc0e53688a3c90c2", "output": "user" } ] } } } }, "edges": [ { "source": "n_fb2aebdaad3b8896", "target": "n_0d3c525feae8ef69" }, { "source": "n_0d3c525feae8ef69", "target": "n_07eaac81ae6cd53e" }, { "source": "n_07eaac81ae6cd53e", "target": "n_5698adfe5a20bdf9" }, { "source": "n_5698adfe5a20bdf9", "target": "n_5af6b5dd756af2da" }, { "source": "n_5af6b5dd756af2da", "target": "n_bc0e53688a3c90c2" }, { "source": "n_bc0e53688a3c90c2", "target": "n_73493948beb05c71" } ] } }, "modules": { "n_1adfa6d075c80bd0": { "name": "Read created user ID", "imports": [], "source": "export default function userIdentity({body}){if(!body||typeof body!=='object'||typeof body.id!=='string'||!body.id.trim())throw Error('Directory API did not return a user ID');return {id:body.id,url:'https://admin.googleapis.com/admin/directory/v1/users/'+encodeURIComponent(body.id)}}\n" }, "n_c6371e50d99d7f97": { "name": "Confirm user identity", "imports": [], "source": "export default function confirm({body,id}){if(!body||typeof body!=='object'||body.id!==id)throw Error('Directory response did not refer to the created user');return{user:body}}\n" } } }, "presentation": { "designer": { "version": 1, "flow": { "direction": "vertical" } } } }