# Decode Base64-encoded string to bytes, then decode bytes to object-init:assign:-project:'${sys.get_env("GOOGLE_CLOUD_PROJECT_ID")}'-subscription:SUBSCRIPTION_ID-pullMessage:# pulls Pub/Sub messagecall:googleapis.pubsub.v1.projects.subscriptions.pullargs:subscription:'${"projects/"+project+"/subscriptions/"+subscription}'body:maxMessages:1result:m-outputMessage:return:'${json.decode(base64.decode(m.receivedMessages[0].message.data))}'
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Function: json.decode\n\nDecodes given JSON bytes (assuming UTF-8), or a string, into an object.\n\nIf the input is bytes, it is first converted to a string, as if by calling\n`text.decode(data, 'UTF-8')`.\n\nArguments\n---------\n\nReturns\n-------\n\nThe decoded object.\n\nRaised exceptions\n-----------------\n\nExamples\n--------\n\nFor more information, see\n[Returning bytes](https://cloud.google.com/workflows/docs/reference/syntax/datatypes.md#bytes). \n\n```yaml\n# Decode Base64-encoded string to bytes, then decode bytes to object\n- init:\n assign:\n - project: '${sys.get_env(\"GOOGLE_CLOUD_PROJECT_ID\")}'\n - subscription: SUBSCRIPTION_ID\n- pullMessage: # pulls Pub/Sub message\n call: googleapis.pubsub.v1.projects.subscriptions.pull\n args:\n subscription: '${\"projects/\" + project + \"/subscriptions/\" + subscription}'\n body:\n maxMessages: 1\n result: m\n- outputMessage:\n return: '${json.decode(base64.decode(m.receivedMessages[0].message.data))}'\n```"]]