Complex experiments such as the stellaratorWendelstein 7-X demand efficient experimental planning, oper-ation, and data evaluation. To assist the process organization atW7-X, a metadata framework has been implemented. It annotatesa physics program with tags describing its intention, mainparameters, boundary conditions, and evaluation results. Theapproach enables relevant metadata to be collected exactly whereinformation is available and to forward it from experimentalplanning and execution to the related entry in the central W7-XLogbook. In consequence, these metadata offer possibilities forclassifying, searching, filtering, and so on, both in the database ofthe prepared programs and in the logbook of the executed pro-grams. Wherever possible, metadata are generated automatically.Starting from the parameters of the program, the frameworkallows typical physics or technical quantities or any programmat-ically extractable information describing the programs intentionto be extracted already while editing. During discharge prepa-ration, metadata are retrieved from the related session planningdocuments and from the actual session environment. ... mehrSupplemen-tary tags can be added manually from an extendible tag catalogto categorize experimental programs or to provide metadata fornot fully integrated diagnostics. All metadata are logged togetherwith status and progress information during execution and areavailable within the program’s log—where the metadata can befinally completed, for example, to manually qualify the success ofthe program or by adding programmatically produced metadatausing the logbook’s programming interface.